linux-stable/drivers/acpi
Armin Wolf c2a30c81bf ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit()
[ Upstream commit e18afcb7b2 ]

After unregistering the CPU idle device, the memory associated with
it is not freed, leading to a memory leak:

unreferenced object 0xffff896282f6c000 (size 1024):
  comm "swapper/0", pid 1, jiffies 4294893170
  hex dump (first 32 bytes):
    00 00 00 00 0b 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace (crc 8836a742):
    [<ffffffff993495ed>] kmalloc_trace+0x29d/0x340
    [<ffffffff9972f3b3>] acpi_processor_power_init+0xf3/0x1c0
    [<ffffffff9972d263>] __acpi_processor_start+0xd3/0xf0
    [<ffffffff9972d2bc>] acpi_processor_start+0x2c/0x50
    [<ffffffff99805872>] really_probe+0xe2/0x480
    [<ffffffff99805c98>] __driver_probe_device+0x78/0x160
    [<ffffffff99805daf>] driver_probe_device+0x1f/0x90
    [<ffffffff9980601e>] __driver_attach+0xce/0x1c0
    [<ffffffff99803170>] bus_for_each_dev+0x70/0xc0
    [<ffffffff99804822>] bus_add_driver+0x112/0x210
    [<ffffffff99807245>] driver_register+0x55/0x100
    [<ffffffff9aee4acb>] acpi_processor_driver_init+0x3b/0xc0
    [<ffffffff990012d1>] do_one_initcall+0x41/0x300
    [<ffffffff9ae7c4b0>] kernel_init_freeable+0x320/0x470
    [<ffffffff99b231f6>] kernel_init+0x16/0x1b0
    [<ffffffff99042e6d>] ret_from_fork+0x2d/0x50

Fix this by freeing the CPU idle device after unregistering it.

Fixes: 3d339dcbb5 ("cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:21:50 -04:00
..
acpica ACPICA: Add AML_NO_OPERAND_RESOLVE flag to Timer 2023-09-23 11:01:04 +02:00
apei ACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events 2024-02-23 08:42:03 +01:00
arm64 perf/smmuv3: Enable HiSilicon Erratum 162001900 quirk for HIP08/09 2023-09-23 11:01:05 +02:00
dptf ACPI: DPTF: Fix reading of attributes 2021-08-04 12:46:39 +02:00
nfit ACPI: NFIT: fix a potential deadlock during NFIT teardown 2023-03-03 11:44:50 +01:00
numa ACPI: HMAT: Fix initiator registration for single-initiator systems 2022-12-08 11:23:59 +01:00
pmic ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses 2021-11-18 14:04:26 +01:00
x86 ACPI / x86: Add not-present quirk for the PCI0.SDHB.BRC1 device on the GPD win 2022-01-27 10:54:13 +01:00
ac.c ACPI: AC: Quirk GK45 to skip reading _PSR 2021-11-18 14:04:00 +01:00
acpi_adxl.c
acpi_amba.c ACPI: AMBA: Fix resource name in /proc/iomem 2021-07-20 16:05:49 +02:00
acpi_apd.c serial: 8250_dw: Add device HID for new AMD UART controller 2021-06-03 09:00:33 +02:00
acpi_cmos_rtc.c
acpi_configfs.c
acpi_dbg.c
acpi_extlog.c ACPI: extlog: fix NULL pointer dereference check 2024-02-23 08:42:03 +01:00
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c ACPI: LPIT: Avoid u32 multiplication overflow 2024-01-25 14:37:40 -08:00
acpi_lpss.c ACPI: LPSS: Fix missing check in register_device_clock() 2022-08-21 15:15:30 +02:00
acpi_memhotplug.c
acpi_pad.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
acpi_platform.c
acpi_pnp.c
acpi_processor.c
acpi_tad.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
acpi_video.c ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop 2024-02-23 08:42:03 +01:00
acpi_watchdog.c
battery.c ACPI: battery: Fix missing NUL-termination with large strings 2023-03-11 16:39:22 +01:00
bgrt.c ACPI: bgrt: Fix CFI violation 2021-07-14 16:56:12 +02:00
blacklist.c
bus.c ACPI: APEI: explicit init of HEST and GHES in apci_init() 2023-09-19 12:20:28 +02:00
button.c ACPI: button: Add lid disable DMI quirk for Nextbook Ares 8A 2023-07-27 08:44:37 +02:00
container.c
cppc_acpi.c ACPI: CPPC: Do not prevent CPPC from working in the future 2022-08-21 15:16:20 +02:00
custom_method.c ACPI: custom_method: fix a possible memory leak 2021-05-11 14:47:12 +02:00
debugfs.c
device_pm.c ACPI: Check StorageD3Enable _DSD property in ACPI code 2023-10-10 21:53:33 +02:00
device_sysfs.c ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() 2023-11-20 11:06:46 +01:00
dock.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
ec.c ACPI: EC: Fix oops when removing custom query handlers 2023-05-30 12:57:48 +01:00
ec_sys.c
event.c
evged.c
fan.c ACPI: PM / fan: Put fan device IDs into separate header file 2021-07-14 16:56:11 +02:00
fan.h ACPI: PM / fan: Put fan device IDs into separate header file 2021-07-14 16:56:11 +02:00
glue.c
hed.c
internal.h ACPI: EC: Rework flushing of EC work while suspended to idle 2022-01-27 10:53:52 +01:00
ioapic.c
irq.c ACPI: irq: Fix incorrect return value in acpi_register_gsi() 2023-10-25 11:54:25 +02:00
Kconfig ACPI: Kconfig: Fix table override from built-in initrd 2021-07-28 14:35:39 +02:00
Makefile ACPI: tables: Add custom DSDT file as makefile prerequisite 2021-07-14 16:56:01 +02:00
nvs.c
osi.c
osl.c
pci_irq.c
pci_link.c
pci_mcfg.c PCI/ACPI: Guard ARM64-specific mcfg_quirks 2022-08-25 11:38:16 +02:00
pci_root.c ACPI: APEI: explicit init of HEST and GHES in apci_init() 2023-09-19 12:20:28 +02:00
pci_slot.c
power.c ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros 2021-07-14 16:56:12 +02:00
pptt.c
proc.c
processor_core.c
processor_driver.c
processor_idle.c ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit() 2024-03-26 18:21:50 -04:00
processor_pdc.c ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 2023-05-17 11:47:42 +02:00
processor_perflib.c ACPI: processor: perflib: Avoid updating frequency QoS unnecessarily 2023-08-11 11:57:44 +02:00
processor_thermal.c ACPI: processor: Remove freq Qos request for all CPUs 2022-08-31 17:15:23 +02:00
processor_throttling.c
property.c acpi: property: Let args be NULL in __acpi_node_get_property_reference 2024-01-25 14:37:54 -08:00
reboot.c
resource.c ACPI: resource: Add another DMI match for the TongFang GMxXGxx 2024-01-25 14:37:38 -08:00
sbs.c
sbshc.c
sbshc.h
scan.c ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes 2022-01-27 10:54:00 +01:00
sleep.c ACPI: PM: save NVS memory for Lenovo G40-45 2022-08-21 15:15:30 +02:00
sleep.h
spcr.c
sysfs.c ACPI: sysfs: Fix BERT error region memory mapping 2022-05-30 09:33:23 +02:00
tables.c ACPI: tables: x86: Reserve memory occupied by ACPI tables 2021-04-07 15:00:08 +02:00
thermal.c ACPI: thermal: drop an always true check 2023-06-09 10:30:15 +02:00
tiny-power-button.c
utils.c
video_detect.c ACPI: video: Add backlight=native DMI quirk for Apple iMac12,1 and iMac12,2 2023-09-23 11:01:05 +02:00
wakeup.c