This is a note to let you know that I've just added the patch titled HID: nvidia-shield: Fix a missing led_classdev_unregister() in the probe error handling path to the 6.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: hid-nvidia-shield-fix-a-missing-led_classdev_unregis.patch and it can be found in the queue-6.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit e60a7575252c9d9d5ad3c16590cfd51c4a1d3d90 Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx> Date: Mon Sep 18 04:54:30 2023 -0700 HID: nvidia-shield: Fix a missing led_classdev_unregister() in the probe error handling path [ Upstream commit b07b6b27a50e3a740c9aa6260ee4bb3ab29515ab ] The commit in Fixes updated the error handling path of thunderstrike_create() and the remove function but not the error handling path of shield_probe(), should an error occur after a successful thunderstrike_create() call. Add the missing call. Make sure it is safe to call in the probe error handling path by preventing the led_classdev from attempting to set the LED brightness to the off state on unregister. Fixes: f88af60e74a5 ("HID: nvidia-shield: Support LED functionality for Thunderstrike") Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx> Reviewed-by: Rahul Rameshbabu <rrameshbabu@xxxxxxxxxx> Signed-off-by: Jiri Kosina <jkosina@xxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c index 9c44974135079..1ce9e42f57c71 100644 --- a/drivers/hid/hid-nvidia-shield.c +++ b/drivers/hid/hid-nvidia-shield.c @@ -482,7 +482,7 @@ static inline int thunderstrike_led_create(struct thunderstrike *ts) led->name = "thunderstrike:blue:led"; led->max_brightness = 1; - led->flags = LED_CORE_SUSPENDRESUME; + led->flags = LED_CORE_SUSPENDRESUME | LED_RETAIN_AT_SHUTDOWN; led->brightness_get = &thunderstrike_led_get_brightness; led->brightness_set = &thunderstrike_led_set_brightness; @@ -694,6 +694,7 @@ static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id) err_haptics: if (ts->haptics_dev) input_unregister_device(ts->haptics_dev); + led_classdev_unregister(&ts->led_dev); return ret; }