summaryrefslogtreecommitdiff
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-01-20 16:43:44 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-02-19 16:28:25 +0100
commit329bb274a3a9144d2fe5a16cdc9b3b05000116b3 (patch)
tree70c9c4e66adaf9698619849d7381b0917374ac28 /drivers/platform/x86
parente8f5d1306a3a5516fe699039614040c084bd6341 (diff)
downloadlinux-329bb274a3a9144d2fe5a16cdc9b3b05000116b3.tar.gz
linux-329bb274a3a9144d2fe5a16cdc9b3b05000116b3.tar.bz2
linux-329bb274a3a9144d2fe5a16cdc9b3b05000116b3.zip
platform/x86: panasonic-laptop: Fix sysfs group leak in error path
[ 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 <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3398370.44csPzL39Z@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/panasonic-laptop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index 7365286f6d2d..ad907c558997 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -1077,7 +1077,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);
@@ -1093,6 +1093,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: