Skip to content

Commit bd060ac

Browse files
committed
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fix from Wolfram Sang: "A bugfix for the I2C core fixing a (rare) race condition" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: core: fix NULL pointer dereference under race condition
2 parents ffbcbfc + 147b36d commit bd060ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/i2c-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2179,6 +2179,7 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
21792179
/* add the driver to the list of i2c drivers in the driver core */
21802180
driver->driver.owner = owner;
21812181
driver->driver.bus = &i2c_bus_type;
2182+
INIT_LIST_HEAD(&driver->clients);
21822183

21832184
/* When registration returns, the driver core
21842185
* will have called probe() for all matching-but-unbound devices.
@@ -2189,7 +2190,6 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
21892190

21902191
pr_debug("driver [%s] registered\n", driver->driver.name);
21912192

2192-
INIT_LIST_HEAD(&driver->clients);
21932193
/* Walk the adapters that are already present */
21942194
i2c_for_each_dev(driver, __process_new_driver);
21952195

0 commit comments

Comments
 (0)