]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
HID: hid-steam: Make sure rumble work is canceled on removal
authorVicki Pfau <vi@endrift.com>
Thu, 26 Dec 2024 02:34:24 +0000 (18:34 -0800)
committerJiri Kosina <jkosina@suse.com>
Thu, 9 Jan 2025 09:17:46 +0000 (10:17 +0100)
When a force feedback command is sent from userspace, work is scheduled to pass
this data to the controller without blocking userspace itself. However, in
theory, this work might not be properly canceled if the controller is removed
at the exact right time. This patch ensures the work is properly canceled when
the device is removed.

Signed-off-by: Vicki Pfau <vi@endrift.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-steam.c

index 6439913372a8a96820c5cf66e3b382cba77c9da6..af38fc8eb34fd3b6cd9f39f2495a3aff5717294d 100644 (file)
@@ -1306,6 +1306,7 @@ static void steam_remove(struct hid_device *hdev)
 
        cancel_delayed_work_sync(&steam->mode_switch);
        cancel_work_sync(&steam->work_connect);
+       cancel_work_sync(&steam->rumble_work);
        hid_destroy_device(steam->client_hdev);
        steam->client_hdev = NULL;
        steam->client_opened = 0;