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)
commitac6888ac5a11c0a47d1f1da4b7809c0c595fdc5d
treead0d649983093866394891e93480940030bfc4e6
parent5e3f89ad8e0cbd75aa3479e9ceb96d9e1c5585b8
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