From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60700284B3B; Tue, 17 Feb 2026 20:50:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771361442; cv=none; b=ehD1+B+MGJSdOI2Y0Ep0cIligd4Ig6QRmnuMbcS1qR0+CPtk7oGXQSZw1ZxZAAzIpkOEMgEaptH/mPDCqSXTic/OhJ3B4ui+HyXqIJvnM8V47SUv5MtYQqun7T3DQFawMpB6nHglOZt7pk6IsRTYFJeJeVu75Ko5cA9OGftYGH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771361442; c=relaxed/simple; bh=WxjWOL8ekMNIH4RN3jnNayYKbE7duakq/OleY98hnLM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Z7EGwwkwkWvrEwn4V2cOJywepqDesvpjFzwx5Ht4zh9rvx1a6IFQC2dW4o6FXnVj6j6JJuhrdfH3PM48qr8I+ErtdqOKnyVsn3iT8jarFoFdLsfuKlrBJsB6IT1OnNWp7u2pl8hufYfo013FtrWbQ+5jC/zX9ySHaPehS+GUmuQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PJe10BqZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PJe10BqZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB18FC4CEF7; Tue, 17 Feb 2026 20:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1771361442; bh=WxjWOL8ekMNIH4RN3jnNayYKbE7duakq/OleY98hnLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PJe10BqZvnH4nAJuxyLCo7TWCPX5ArfMcS/b3WoZbumw7IiEDSpURNJJvAtf+ajOO 4Tf4OvaeqI6ndJUVx2Lw7yWYFtJqPm9onhTNIyZtE4sY7Jeb88ICxa+AOv32IEW/+E w6lWCdlrJdi8+X5hAevrjPfmT7aGWSezB6CA9xcY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Rafael J. Wysocki" , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Sasha Levin Subject: [PATCH 6.18 18/43] platform/x86: panasonic-laptop: Fix sysfs group leak in error path Date: Tue, 17 Feb 2026 21:31:58 +0100 Message-ID: <20260217200007.166350768@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260217200006.470920131@linuxfoundation.org> References: <20260217200006.470920131@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rafael J. Wysocki [ Upstream commit 43b0b7eff4b3fb684f257d5a24376782e9663465 ] The acpi_pcc_hotkey_add() error path leaks sysfs group pcc_attr_group if platform_device_register_simple() fails for the "panasonic" platform device. Address this by making it call sysfs_remove_group() in that case for the group in question. Signed-off-by: Rafael J. Wysocki Link: https://patch.msgid.link/3398370.44csPzL39Z@rafael.j.wysocki Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen Signed-off-by: Sasha Levin --- drivers/platform/x86/panasonic-laptop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 255317e6fec88..937f1a5b78edf 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -1089,7 +1089,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) PLATFORM_DEVID_NONE, NULL, 0); if (IS_ERR(pcc->platform)) { result = PTR_ERR(pcc->platform); - goto out_backlight; + goto out_sysfs; } result = device_create_file(&pcc->platform->dev, &dev_attr_cdpower); @@ -1105,6 +1105,8 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) out_platform: platform_device_unregister(pcc->platform); +out_sysfs: + sysfs_remove_group(&device->dev.kobj, &pcc_attr_group); out_backlight: backlight_device_unregister(pcc->backlight); out_input: -- 2.51.0