[PATCH v2 10/10] HID: playstation: Cancel DualSense output worker on create failure
From: Lee Jones
Date: Fri Nov 27 2026 - 12:08:43 EST
dualsense_create() schedules ds->output_worker via
dualsense_set_lightbar() before registering player LEDs and assigning a
player ID. If either step fails, the error path returns without
cancelling ds->output_worker, leaving queued or running work accessing
ds after devres frees it in hid_device_probe().
Call dualsense_remove() in the dualsense_create() error path to disable
further scheduling and cancel ds->output_worker synchronously.
Fixes: 949aaccda019 ("HID: playstation: add DualSense player LED support.")
Fixes: 182934a1e93b ("HID: playstation: stop DualSense output work on remove.")
Closes: https://sashiko.dev/#/bug/linux-b657d8df-afc1-429c-9bf5-b2583501dedd
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
v1 => v2:
- No changes.
drivers/hid/hid-playstation.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
index 24e448076e35..9650bbe233dc 100644
--- a/drivers/hid/hid-playstation.c
+++ b/drivers/hid/hid-playstation.c
@@ -1906,6 +1906,7 @@ static struct ps_device *dualsense_create(struct hid_device *hdev)
return &ds->base;
err:
+ dualsense_remove(ps_dev);
ps_devices_list_remove(ps_dev);
return ERR_PTR(ret);
}
--
2.56.1.839.g22a8290db9-goog