From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383429; b=NZeKIh3Mmv/vjKKygIqZj2crpv343XDY0SflL3dIBm+iWD3gnFyRgk8uxg9nrxCD70tb VAFVjsLCdg4Jq/dFtHNrHsNvUd8jE2uHqT/BYFDpVe8v9vHRZR5kKhQBE3MfacRTMbIPl i3ljRX1ScasX84Dbuz4GS0Wp4dkIFimbWuc7GXo7Ss40JktPqXVTEAxTfKamt0roOjb7a S5Fuy76cmjSMBtj+EKkf7X8fjM9xvPQ+WUEerPYUDTZiYQwX4vz7KmQo1ESYLh5rEKNwh Snxx6IbqM4FEtjEvjtjH7hEHgozMUZFrZmI1fom3QHmXAOj3EZrpDgfttQcEb+Z0GKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383429; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Kdn1bVMvLXAJLhPFComknNlQKnrmK8MzQB8nDMnfwsQ=; b=Le8v6d21GRlQLswQ326yLYkESJxI86ddo8mRnvowuEJq+xiyCN9taQpvdmV8FsyPkid6 wGot7N9LOEfD9mpEBikiHuwz6BdRZBSjgKtqRl/HK6szUC7+i9IhJrJN/VJkMY2AbnCNe 66C3lapfiebNYIxlr+ynUStThj+0rBwKuF5D3qh2giVWeoTQPq1ZUN9kdHsD23XNIouWX tzJCZvheKtAaMTCOAI5PvjQIy5Ba/AdyIfQ8LmjgakPX0ymnPB1R3tDPLcw5L3/Hqos8I JFeo9iRiGbx/GvO4LSkk+4KMW8RG40WCO8Xqg3ysUa1sxWX2LYzPUYh2Ep/9PXN77Dw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=CL7PL8Pr; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4889C606A334; Fri, 4 Dec 2026 11:23:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=CL7PL8Pr Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96A801F00A07; Fri, 4 Dec 2026 11:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383429; bh=Kdn1bVMvLXAJLhPFComknNlQKnrmK8MzQB8nDMnfwsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CL7PL8PrCxAgDMVZD/rUD1IS/AVoBEIiNzA+Si/0G89LNLoL/oE/FVkibW8pQpeCz BgyfenWmOJkA3cBJBmzecjFLCaf1aiOPByT2g66MFkT56VXufHxD0mSIhC9We1YdoI fOhrKaybPjgDmBxr44wII/f/e5LTtoS7BvFvvfnA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Changyul Lee , Sang-Hoon Choi , Jiri Kosina , Sasha Levin Subject: [PATCH 6.12 221/555] HID: nintendo: release the player ID when LED setup fails Date: Fri, 4 Dec 2026 19:04:24 +0900 Message-ID: <20261204100617.476583912@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sang-Hoon Choi [ Upstream commit 10bc1d627c297097cfdc099377f8a13efdfffd86 ] 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 Assisted-by: LLM Signed-off-by: Sang-Hoon Choi Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-nintendo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c index ea7751b3555c0..317db8648a766 100644 --- a/drivers/hid/hid-nintendo.c +++ b/drivers/hid/hid-nintendo.c @@ -2702,7 +2702,7 @@ static int nintendo_hid_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 */ -- 2.53.0