* subclient leak in asb100 driver
2005-05-19 6:24 subclient leak in asb100 driver Jean Delvare
@ 2005-05-19 6:24 ` Jean Delvare
2005-05-19 6:24 ` Mark M. Hoffman
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jean Delvare @ 2005-05-19 6:24 UTC (permalink / raw)
To: lm-sensors
> Nope, the I2C core calls asb100_detach_client() three times... once
> for the primary client and twice more for the subclients.
Ohhhh OK. Now I get it. It's a bit confusing at first. I'd have expected
two different detach functions (i.e. two different driver structures).
But I agree it works.
> The changes in 2.6 are also on purpose. They're necessary because the
> I2C client list was implemented differently than in 2.4, which caused
> it to try to release the subclients twice.
I didn't see much change, except the sysctl_id being gone.
> I.e. technically, it's the CVS w83781d driver that's wrong... although
> it happens to be benign vs. 2.4 kernel.
Yes, I see that now. I'm surprised that it doesn't cause more trouble
than it does. Care to correct the 2.4/CVS driver so that it does what
your asb100 driver does (i.e. the right thing)?
Thanks.
--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
^ permalink raw reply [flat|nested] 5+ messages in thread* subclient leak in asb100 driver
2005-05-19 6:24 subclient leak in asb100 driver Jean Delvare
2005-05-19 6:24 ` Jean Delvare
@ 2005-05-19 6:24 ` Mark M. Hoffman
2005-05-19 6:24 ` Mark M. Hoffman
2005-05-19 6:24 ` Jean Delvare
3 siblings, 0 replies; 5+ messages in thread
From: Mark M. Hoffman @ 2005-05-19 6:24 UTC (permalink / raw)
To: lm-sensors
* Jean Delvare <khali@linux-fr.org> [2004-04-10 11:05:33 +0200]:
> I think that there is a i2c client and memory leak in your asb100 driver
> (2.4/CVS). In asb100_detach_client, you neither call i2c_detach_client
> on subclients, nor do you kfree their memory.
Nope, the I2C core calls asb100_detach_client() three times... once for the
primary client and twice more for the subclients.
> I think that the same problem exists in the 2.6 version of the driver,
> as well as in the w83781d driver there. The 2.4/CVS version of the
> w83781d driver, on the other hand, seems OK.
The changes in 2.6 are also on purpose. They're necessary because the
I2C client list was implemented differently than in 2.4, which caused
it to try to release the subclients twice.
I.e. technically, it's the CVS w83781d driver that's wrong... although
it happens to be benign vs. 2.4 kernel.
Regards,
--
Mark M. Hoffman
mhoffman@lightlink.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* subclient leak in asb100 driver
2005-05-19 6:24 subclient leak in asb100 driver Jean Delvare
2005-05-19 6:24 ` Jean Delvare
2005-05-19 6:24 ` Mark M. Hoffman
@ 2005-05-19 6:24 ` Mark M. Hoffman
2005-05-19 6:24 ` Jean Delvare
3 siblings, 0 replies; 5+ messages in thread
From: Mark M. Hoffman @ 2005-05-19 6:24 UTC (permalink / raw)
To: lm-sensors
* Jean Delvare <khali@linux-fr.org> [2004-05-09 12:56:36 +0200]:
> Hi Mark,
>
> > > I.e. technically, it's the CVS w83781d driver that's wrong...
> > > although it happens to be benign vs. 2.4 kernel.
> >
> > Yes, I see that now. I'm surprised that it doesn't cause more trouble
> > than it does. Care to correct the 2.4/CVS driver so that it does what
> > your asb100 driver does (i.e. the right thing)?
>
> I took a longer look at the w83781d driver and finally, it doesn't seem
> to be broken. It simply relies on the fact that i2c-core will detach the
> clients on the same order they were attached. Since the w83781d driver
> attached the main client before attaching the subclients, the main
> client is detached first. In the callback function, the driver detaches
> the subclients "manually" (as opposed to letting i2c-core take care).
> When returning from the callback function, the subclients are already
> gone, so i2c-core doesn't do anything for them (verified).
Exactly. That's what I meant by "happens to be benign".
> So I don't think there's anything that needs fixing here. Let me know if
> I missed something.
That's fine with me.
Regards,
--
Mark M. Hoffman
mhoffman@lightlink.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* subclient leak in asb100 driver
2005-05-19 6:24 subclient leak in asb100 driver Jean Delvare
` (2 preceding siblings ...)
2005-05-19 6:24 ` Mark M. Hoffman
@ 2005-05-19 6:24 ` Jean Delvare
3 siblings, 0 replies; 5+ messages in thread
From: Jean Delvare @ 2005-05-19 6:24 UTC (permalink / raw)
To: lm-sensors
Hi Mark,
> > I.e. technically, it's the CVS w83781d driver that's wrong...
> > although it happens to be benign vs. 2.4 kernel.
>
> Yes, I see that now. I'm surprised that it doesn't cause more trouble
> than it does. Care to correct the 2.4/CVS driver so that it does what
> your asb100 driver does (i.e. the right thing)?
I took a longer look at the w83781d driver and finally, it doesn't seem
to be broken. It simply relies on the fact that i2c-core will detach the
clients on the same order they were attached. Since the w83781d driver
attached the main client before attaching the subclients, the main
client is detached first. In the callback function, the driver detaches
the subclients "manually" (as opposed to letting i2c-core take care).
When returning from the callback function, the subclients are already
gone, so i2c-core doesn't do anything for them (verified).
So I don't think there's anything that needs fixing here. Let me know if
I missed something.
--
Jean Delvare
http://khali.linux-fr.org/
^ permalink raw reply [flat|nested] 5+ messages in thread