]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: nvidia-shield: Fix a missing led_classdev_unregister() in the probe error handli...
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 18 Sep 2023 11:54:30 +0000 (04:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 20:03:04 +0000 (22:03 +0200)
commite0ae4814bf7d0826e9f0afd99bb142bb7601d0b1
treeb55915d35962001e1fb2e831aa9a60dbaf3fc9df
parenteba44cd3094892e8c42252dc56d1ba4c4f7a749a
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@wanadoo.fr>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-nvidia-shield.c