]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (occ) Lock mutex in shutdown to prevent race with occ_active
authorEddie James <eajames@linux.ibm.com>
Mon, 6 Jun 2022 18:54:55 +0000 (13:54 -0500)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 7 Jun 2022 12:45:42 +0000 (05:45 -0700)
commit33151d02ca753107a03d83e8918f52de8483fa0c
treead0d649983093866394891e93480940030bfc4e6
parent9d91dd1db42afb16fcd16adf48d9978e339a4114
hwmon: (occ) Lock mutex in shutdown to prevent race with occ_active

Unbinding the driver or removing the parent device at the same time
as using the OCC active sysfs file can cause the driver to unregister
the hwmon device twice. Prevent this by locking the occ mutex in the
shutdown function.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/20220606185455.21126-1-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/occ/common.c