Re: [PATCH 12/24] media/video: fix dangling pointers

2010-04-01 Thread Hans Verkuil
On Tuesday 30 March 2010 14:39:12 Wolfram Sang wrote: > Hans, > > > But this just feels like an i2c core thing to me. After remove() is called > > the core should just set the client data to NULL. If there are drivers that > > rely on the current behavior, then those drivers should be reviewed fir

Re: [PATCH 12/24] media/video: fix dangling pointers

2010-03-30 Thread Wolfram Sang
Hans, > But this just feels like an i2c core thing to me. After remove() is called > the core should just set the client data to NULL. If there are drivers that > rely on the current behavior, then those drivers should be reviewed first as > to the reason why they need it. It will be done this wa

Re: [PATCH 12/24] media/video: fix dangling pointers

2010-03-22 Thread Wolfram Sang
> > > Personally I'd much rather just not bother setting the driver data in > > > the removal path, it seems unneeded. I had assumed that the subsystem > > > code cared for some reason when I saw the patch series. > > > > Anyway, should this really be necessary, then for the media drivers this >

Re: [PATCH 12/24] media/video: fix dangling pointers

2010-03-22 Thread Mark Brown
On Mon, Mar 22, 2010 at 09:33:58PM +0100, Jean Delvare wrote: > On Sun, 21 Mar 2010 17:09:56 +0100, Hans Verkuil wrote: > > On Sunday 21 March 2010 15:14:17 Mark Brown wrote: > > > I agree with this. There are also some use cases where the device data > > > is actually static (eg, a generic descr

Re: [PATCH 12/24] media/video: fix dangling pointers

2010-03-22 Thread Jean Delvare
Replying to myself... On Sun, 21 Mar 2010 14:46:55 +0100, Jean Delvare wrote: > I get the feeling that this would be a job for managed resources as > some drivers already do for I/O ports and IRQs. Managed resources don't > care about symmetry of allocation and freeing, by design (so it can > viol

Re: [PATCH 12/24] media/video: fix dangling pointers

2010-03-22 Thread Jean Delvare
Hi Hans, Mark, Wolfram, On Sun, 21 Mar 2010 17:09:56 +0100, Hans Verkuil wrote: > On Sunday 21 March 2010 15:14:17 Mark Brown wrote: > > On Sun, Mar 21, 2010 at 02:46:55PM +0100, Jean Delvare wrote: > > > On Sat, 20 Mar 2010 23:02:49 +0100, Hans Verkuil wrote: > > > > > > I feel I am missing some

Re: [PATCH 12/24] media/video: fix dangling pointers

2010-03-21 Thread Hans Verkuil
On Sunday 21 March 2010 15:14:17 Mark Brown wrote: > On Sun, Mar 21, 2010 at 02:46:55PM +0100, Jean Delvare wrote: > > On Sat, 20 Mar 2010 23:02:49 +0100, Hans Verkuil wrote: > > > > I feel I am missing something here. Why does clientdata have to be set to > > > NULL when we are tearing down the d

Re: [PATCH 12/24] media/video: fix dangling pointers

2010-03-21 Thread Mark Brown
On Sun, Mar 21, 2010 at 02:46:55PM +0100, Jean Delvare wrote: > On Sat, 20 Mar 2010 23:02:49 +0100, Hans Verkuil wrote: > > I feel I am missing something here. Why does clientdata have to be set to > > NULL when we are tearing down the device anyway? > We're not tearing down the device, that's th

Re: [PATCH 12/24] media/video: fix dangling pointers

2010-03-21 Thread Jean Delvare
Hi Hans, On Sat, 20 Mar 2010 23:02:49 +0100, Hans Verkuil wrote: > On Saturday 20 March 2010 15:12:53 Wolfram Sang wrote: > > Fix I2C-drivers which missed setting clientdata to NULL before freeing the > > structure it points to. Also fix drivers which do this _after_ the structure > > was freed al

Re: [PATCH 12/24] media/video: fix dangling pointers

2010-03-21 Thread Wolfram Sang
Hello Hans, > > Fix I2C-drivers which missed setting clientdata to NULL before freeing the > > structure it points to. Also fix drivers which do this _after_ the structure > > was freed already. > > I feel I am missing something here. Why does clientdata have to be set to > NULL when we are teari

Re: [PATCH 12/24] media/video: fix dangling pointers

2010-03-20 Thread Hans Verkuil
On Saturday 20 March 2010 15:12:53 Wolfram Sang wrote: > Fix I2C-drivers which missed setting clientdata to NULL before freeing the > structure it points to. Also fix drivers which do this _after_ the structure > was freed already. I feel I am missing something here. Why does clientdata have to be

[PATCH 12/24] media/video: fix dangling pointers

2010-03-20 Thread Wolfram Sang
Fix I2C-drivers which missed setting clientdata to NULL before freeing the structure it points to. Also fix drivers which do this _after_ the structure was freed already. Signed-off-by: Wolfram Sang Cc: Mauro Carvalho Chehab --- Found using coccinelle, then reviewed. Full patchset is available