summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSang-Hoon Choi <csh0052@gmail.com>2026-09-22 03:49:28 +0900
committerJiri Kosina <jkosina@suse.com>2026-11-20 14:59:26 +0100
commit10bc1d627c297097cfdc099377f8a13efdfffd86 (patch)
tree0ea9423d39d09b3d96c955ecf0f130c7f3db6cb7
parent314f3a84a49480488e67fabbae70a2262ea2a33c (diff)
HID: nintendo: release the player ID when LED setup fails
joycon_leds_create() allocates a player ID before allocating the LED names and registering the LEDs. If one of those later steps fails, nintendo_hid_probe() jumps to err_io_stop and skips the ID cleanup. The failed probe leaves the allocated ID in nintendo_player_id_allocator. Use err_ida for this failure, as the power supply and input setup error paths already do. If the ID allocation itself failed, player_id is U32_MAX and ida_free() leaves the allocator untouched. Fixes: 5307de63d71d ("HID: nintendo: use ida for LED player id") Reported-by: Changyul Lee <lcy8047@gmail.com> Assisted-by: LLM Signed-off-by: Sang-Hoon Choi <csh0052@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
-rw-r--r--drivers/hid/hid-nintendo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index c2a35154cc6c..86d41d67eef4 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -2791,7 +2791,7 @@ static int joycon_probe(struct hid_device *hdev,
ret = joycon_leds_create(ctlr);
if (ret) {
hid_err(hdev, "Failed to create leds; ret=%d\n", ret);
- goto err_io_stop;
+ goto err_ida;
}
/* Initialize the battery power supply */