HID: nvidia-shield: Remove led_classdev_unregister in thunderstrike_create
authorRahul Rameshbabu <rrameshbabu@nvidia.com>
Mon, 7 Aug 2023 16:36:18 +0000 (09:36 -0700)
committerJiri Kosina <jkosina@suse.cz>
Mon, 14 Aug 2023 09:41:17 +0000 (11:41 +0200)
commitcb818a047f2b95f3d9e08568ff7f8f513832ff2f
tree55ae19401260198b8df9c5790b1a95c2ec9df8ac
parent1d7546042f8fdc4bc39ab91ec966203e2d64f8bd
HID: nvidia-shield: Remove led_classdev_unregister in thunderstrike_create

Avoid calling thunderstrike_led_set_brightness from thunderstrike_create
when led_classdev_unregister is called. led_classdev_unregister was called
from thunderstrike_create in the error path. Calling
thunderstrike_led_set_brightness in this situation is unsafe.

Fixes: f88af60e74a5 ("HID: nvidia-shield: Support LED functionality for Thunderstrike")
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-nvidia-shield.c