mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
HID: hid-lenovo-go-s: Prevent deadlock if device removed during setup
hid_gos_cfg_remove() calls a mutex before canceling delayed work. That
delayed work function calls mcu_property_out(), which holds the same mutex.
Prevent deadlock my removing the mutex prior to stopping the work.
Additionally, since cancel_delayed_work has the potential to re-arm,
switch to disable_delayed_work.
Fixes: a23f3497bf ("HID: hid-lenovo-go-s: Add Lenovo Legion Go S Series HID Driver")
Cc: stable@vger.kernel.org
Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
6224755416
commit
0ef3036c68
|
|
@ -1442,8 +1442,7 @@ static int hid_gos_cfg_probe(struct hid_device *hdev,
|
|||
|
||||
static void hid_gos_cfg_remove(struct hid_device *hdev)
|
||||
{
|
||||
guard(mutex)(&drvdata.cfg_mutex);
|
||||
cancel_delayed_work_sync(&drvdata.gos_cfg_setup);
|
||||
disable_delayed_work_sync(&drvdata.gos_cfg_setup);
|
||||
sysfs_remove_groups(&hdev->dev.kobj, top_level_attr_groups);
|
||||
hid_hw_close(hdev);
|
||||
hid_hw_stop(hdev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user