From: Greg Kroah-Hartman Date: Tue, 17 Apr 2018 14:51:05 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.16.3~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2100b14007b52cfd80faa4b31ec17449bacb1484;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: hwmon-ina2xx-fix-access-to-uninitialized-mutex.patch --- diff --git a/queue-4.9/hwmon-ina2xx-fix-access-to-uninitialized-mutex.patch b/queue-4.9/hwmon-ina2xx-fix-access-to-uninitialized-mutex.patch new file mode 100644 index 00000000000..c4e2fd3513b --- /dev/null +++ b/queue-4.9/hwmon-ina2xx-fix-access-to-uninitialized-mutex.patch @@ -0,0 +1,69 @@ +From 0c4c5860e9983eb3da7a3d73ca987643c3ed034b Mon Sep 17 00:00:00 2001 +From: Marek Szyprowski +Date: Mon, 15 Jan 2018 14:58:21 +0100 +Subject: hwmon: (ina2xx) Fix access to uninitialized mutex + +From: Marek Szyprowski + +commit 0c4c5860e9983eb3da7a3d73ca987643c3ed034b upstream. + +Initialize data->config_lock mutex before it is used by the driver code. + +This fixes following warning on Odroid XU3 boards: + +INFO: trying to register non-static key. +the code is fine but needs lockdep annotation. +turning off the locking correctness validator. +CPU: 5 PID: 1 Comm: swapper/0 Not tainted 4.15.0-rc7-next-20180115-00001-gb75575dee3f2 #107 +Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) +[] (unwind_backtrace) from [] (show_stack+0x10/0x14) +[] (show_stack) from [] (dump_stack+0x90/0xc8) +[] (dump_stack) from [] (register_lock_class+0x1c0/0x59c) +[] (register_lock_class) from [] (__lock_acquire+0x78/0x1850) +[] (__lock_acquire) from [] (lock_acquire+0xc8/0x2b8) +[] (lock_acquire) from [] (__mutex_lock+0x60/0xa0c) +[] (__mutex_lock) from [] (mutex_lock_nested+0x1c/0x24) +[] (mutex_lock_nested) from [] (ina2xx_set_shunt+0x70/0xb0) +[] (ina2xx_set_shunt) from [] (ina2xx_probe+0x88/0x1b0) +[] (ina2xx_probe) from [] (i2c_device_probe+0x1e0/0x2d0) +[] (i2c_device_probe) from [] (driver_probe_device+0x2b8/0x4a0) +[] (driver_probe_device) from [] (__driver_attach+0xfc/0x120) +[] (__driver_attach) from [] (bus_for_each_dev+0x58/0x7c) +[] (bus_for_each_dev) from [] (bus_add_driver+0x174/0x250) +[] (bus_add_driver) from [] (driver_register+0x78/0xf4) +[] (driver_register) from [] (i2c_register_driver+0x38/0xa8) +[] (i2c_register_driver) from [] (do_one_initcall+0x48/0x18c) +[] (do_one_initcall) from [] (kernel_init_freeable+0x110/0x1d4) +[] (kernel_init_freeable) from [] (kernel_init+0x8/0x114) +[] (kernel_init) from [] (ret_from_fork+0x14/0x20) + +Fixes: 5d389b125186 ("hwmon: (ina2xx) Make calibration register value fixed") +Signed-off-by: Marek Szyprowski +Signed-off-by: Guenter Roeck +[backport to v4.4.y/v4.9.y: context changes] +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/ina2xx.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/hwmon/ina2xx.c ++++ b/drivers/hwmon/ina2xx.c +@@ -447,6 +447,7 @@ static int ina2xx_probe(struct i2c_clien + + /* set the device type */ + data->config = &ina2xx_config[id->driver_data]; ++ mutex_init(&data->config_lock); + + if (of_property_read_u32(dev->of_node, "shunt-resistor", &val) < 0) { + struct ina2xx_platform_data *pdata = dev_get_platdata(dev); +@@ -473,8 +474,6 @@ static int ina2xx_probe(struct i2c_clien + return -ENODEV; + } + +- mutex_init(&data->config_lock); +- + data->groups[group++] = &ina2xx_group; + if (id->driver_data == ina226) + data->groups[group++] = &ina226_group; diff --git a/queue-4.9/series b/queue-4.9/series index b8f82a9121a..8378b151a3d 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -58,3 +58,4 @@ s390-ipl-ensure-loadparm-valid-flag-is-set.patch getname_kernel-needs-to-make-sure-that-name-iname-in-long-case.patch bluetooth-fix-connection-if-directed-advertising-and-privacy-is-used.patch rtl8187-fix-null-pointer-dereference-in-priv-conf_mutex.patch +hwmon-ina2xx-fix-access-to-uninitialized-mutex.patch