[i2c] i2c: cdev lock_kernel() pushdown

Jonathan Corbet corbet at lwn.net
Tue Jul 15 18:52:11 CEST 2008


On Tue, 15 Jul 2008 18:35:52 +0200
Jean Delvare <khali at linux-fr.org> wrote:

> Good point. i2c_dev is guaranteed to stay thanks to the call to
> i2c_get_adapter(), however it happens _after_ the call to
> i2c_dev_get_by_minor(), so without additional locking, this is racy.
> That being said, I'm not sure how lock_kernel() is supposed to help.
> Is the BKL held when i2cdev_detach_adapter() is called? If not, then I
> suspect that the current code is already racy.

A quick look suggests that there will be no BKL protection for
i2cdev_detach_adapter().  So, yes, I think it doesn't help here.  

jon



More information about the i2c mailing list