diff options
| author | Huisong Li <lihuisong@huawei.com> | 2025-07-28 15:06:11 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-10-15 11:59:57 +0200 |
| commit | 31ff8aa00948bd79f4f8c43a3fe56719b044ec18 (patch) | |
| tree | 1ac7cfe422dec6eecee5d3a60d30d3a8a826e42a /drivers/acpi | |
| parent | 016219d54c900492f6a37d148ac2d05d3de3304f (diff) | |
| download | linux-31ff8aa00948bd79f4f8c43a3fe56719b044ec18.tar.gz linux-31ff8aa00948bd79f4f8c43a3fe56719b044ec18.tar.bz2 linux-31ff8aa00948bd79f4f8c43a3fe56719b044ec18.zip | |
ACPI: processor: idle: Fix memory leak when register cpuidle device failed
[ Upstream commit 11b3de1c03fa9f3b5d17e6d48050bc98b3704420 ]
The cpuidle device's memory is leaked when cpuidle device registration
fails in acpi_processor_power_init(). Free it as appropriate.
Fixes: 3d339dcbb56d ("cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure")
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Link: https://patch.msgid.link/20250728070612.1260859-2-lihuisong@huawei.com
[ rjw: Changed the order of the new statements, added empty line after if () ]
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/acpi')
| -rw-r--r-- | drivers/acpi/processor_idle.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 0888e4d618d5..b524cf27213d 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1410,6 +1410,9 @@ int acpi_processor_power_init(struct acpi_processor *pr) if (retval) { if (acpi_processor_registered == 0) cpuidle_unregister_driver(&acpi_idle_driver); + + per_cpu(acpi_cpuidle_device, pr->id) = NULL; + kfree(dev); return retval; } acpi_processor_registered++; |
