[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100323003525.GC5762@pengutronix.de>
Date: Tue, 23 Mar 2010 01:35:25 +0100
From: Wolfram Sang <w.sang@...gutronix.de>
To: Jean Delvare <khali@...ux-fr.org>
Cc: Hans Verkuil <hverkuil@...all.nl>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
kernel-janitors@...r.kernel.org, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org,
Mauro Carvalho Chehab <mchehab@...radead.org>,
linux-media@...r.kernel.org
Subject: Re: [PATCH 12/24] media/video: fix dangling pointers
> > > 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
> > should be done in v4l2_device_unregister_subdev() and not in every driver.
> >
> > 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.
>
> I tend to agree, now.
>
> Wolfram, how do you feel about this? I feel a little sorry that I more
> or less encouraged you to submit this patch series, and now I get to
> agree with the objections which were raised against it.
Well, this is a valuable outcome in my book. Maybe seeing the actual amount of
modifications necessary for cleaning up clientdata helped the process. While
working on it, I also got the impression that it should be handled differently
in the future, of course. Although I was thinking of something different
('i2c_(allocate|free)_clientdata' as mentioned before), I prefer the above
proposal as it is most simple.
> My key motivation was that I wanted i2c_set_clientdata() to be called
> before kfree(). Now that everybody seems to agree that the latter
> belongs to the drivers while the former belongs to lower layers
> (i2c-core or even driver core), this is not going to happen. So I guess
> we want to remove calls to i2c_set_clientdata(NULL) from all drivers
> and have only one in i2c-core for now?
Fine with me. Let me know if I can assist you with the series.
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)
Powered by blists - more mailing lists