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=1796380187; b=tVh+9CsgGTgz7N5wNP/Lu+TDw+5aqwOWDwEmR8KZ2KBK9q/Pt1VWkd4RbLJGA/4T8ncC r8oaOFZhksbC8GNy+D5paTEuTau4IMn4eo9hXazEQxxYAf+Je3G2BOwJ7dDwAQ8JeqBZ9 8Kp8+t3lnRVsKDffVEDVjafFJrdjJujQwWyNkm7wb5pnCGZjCbtjJrmOit56bOVS+ZjT+ bBQkloCYbGfJ/frGBkhA6CdYSQ7VqH6/bdmg06KC/QTV/UHJ9wAHnfU9/OhzphkHyZgqM jBaOuElwhOztX6iujcYG4W11+nkNZotWl6bVdMJzODoIyt8nAbj4RNkF18lO6XuJJ3Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380187; 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=4PoYrzQajjO1V4QAR+qKlt2/t7q44iei/g//WrZHZ3g=; b=eFyNPC/u2mii4jWyYlNRRMQUwhXfo15e3GZO+ofP7GaL4Aou9d8GOP8S+/aTuukUu03R EHyb31YW8+brteaqjxNCI0WzI3DDuosKnVdHhnWPcRknU9XWlHfQOKECD+cOrAZMOGc+o xX4mr1F7wksdsjdDEvSEZuYdEEGpXuQOUDRZzK4DHh2UUDKAPHSE+9pOP2FCeifp86NFS VvDeGQ643yQzZUCo5R8qQcFzMq3lkJtH5qaKTqB+d+/GNHlJxILBAWoH1H11mtgc21hwp Q0JSABp0jkXA48vsRP6PEy3OTumWD7klun1BbXwLrc1i6mlAzfEod7n/KCcNBJqgdLw== 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=V3+HN7oR; 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 E6FD5606A684; Fri, 4 Dec 2026 10:29:46 +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=V3+HN7oR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AA1A1F00A18; Fri, 4 Dec 2026 10:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380186; bh=4PoYrzQajjO1V4QAR+qKlt2/t7q44iei/g//WrZHZ3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=V3+HN7oRXgq/NAylXcMbEkAShLHQjhFunWvnc2f8L1JTz1Zpv/uYAu5JPC4Gz6PNz KSUkk98v/AeHkpmFIqPLrmNzALQ9Mo1gjsHlWN2FCDyPNmB7V2zKlMCm0UaCc1zVPp xgNnBzK9iQsNarlZtRNI2AEiDGKJMbkTc+kCBOc8= 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 7.3 163/742] HID: nintendo: release the player ID when LED setup fails Date: Fri, 4 Dec 2026 19:00:27 +0900 Message-ID: <20261204100639.439682396@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 b1fcf3e5767ba..23b836a766f30 100644 --- a/drivers/hid/hid-nintendo.c +++ b/drivers/hid/hid-nintendo.c @@ -2784,7 +2784,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