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=1796381867; b=oGMhQdhFZtdf7b1SWUDdurbiR/wak69PwQsjoS1+RhdkHpwaljRI8aV74dRtviKXkpp3 LM+02zn+xPauiHXfOgub+96hq+/gGGsDv6RiE7Acr2MgjUlTPwrtdz8eYL9WZEpp4bFdv dFN7PFmbHW6SobHkd9EonAVSkevRPah4nnqwBg41SEEPCZBUWNMP/2OT6p6VV0QYoUiDK fosec2tY3tL3+cB+HD6MNRND7zxh8B9pUhRTvdIb6Y1mRvHpuORXxjmsdHUy9qIIiuqMy F7NBzT+rY4C8EalFxEnmXnx61oImZcvR8hHQhmDEI8vDkhnyb0IL0oX0PrxZ9hNe3bQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381867; 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=rmrBNK44Z3KDal+k4Z1izxd1VTGZaGKQMF/7Xgt9xQ8=; b=nfsu2fcqKq5C3pKdceZQXmOGcNexBs+Yk/8NJNAMuFi/WwXgbb/4VymZ+jA8XRZIzrNi npgF9u+ZQsrfTqso1tDldpUPG6zXG9VhZEz/E4HUtQVj/xTJrKAWsO4XPhdOqehjbRQ8f QwmWxFBbQi2taWwY1/7XQbF33wmkmDtVSpcE99kD2Xy0s5GCg7yjzbPbKZvCxu3V9ITsO y1RKc2m8itGfDwSyvmTuAQ3C8AKp3Jyl7SO2Q+14EzP31eYItWN32lVMt9Gs+TD6xNNOc EVkWHqfJgmu6iNLHpkGRrj7YNCB72yA+3n+pVhu7+K8M3lapjULBGA2jNHCHD6CqT6g== 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=eKxumpPQ; 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 3CC80606A32C; Fri, 4 Dec 2026 10:57:47 +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=eKxumpPQ Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5BDD1F000CE; Fri, 4 Dec 2026 10:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381867; bh=rmrBNK44Z3KDal+k4Z1izxd1VTGZaGKQMF/7Xgt9xQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eKxumpPQYoTvdmX5YSuyvzg/IWSRDQdc8THBKVAvW5uDHpcjRa+RJ0bd+cBMpiyzw M+hfAinyL9hdn79/kICB7iGWz3plE22V5Yl74QhvE/Wul290G6oH2oN1lUeLvli9Fo SXBhWlhAmi2HlzL+Wta0A3deuzNjMqV95eG0sdws= 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.18 208/703] HID: nintendo: release the player ID when LED setup fails Date: Fri, 4 Dec 2026 19:01:47 +0900 Message-ID: <20261204100633.381598429@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-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 34642352b439d..e3db2e3531787 100644 --- a/drivers/hid/hid-nintendo.c +++ b/drivers/hid/hid-nintendo.c @@ -2698,7 +2698,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