diff options
| author | Priyank Rathod <rathodpriyank@google.com> | 2026-09-28 17:40:13 +0000 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2026-10-05 18:23:40 -0500 |
| commit | d4c842c3af5bc52b3ca0b8a7f116114e43b6ba44 (patch) | |
| tree | 57e088c7967004d94b45502eeed1a66ab9f42884 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | 07938f8a3cbf3e9cc27553b8982e2d56c15b354a (diff) | |
PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing
When ACPI APEI/GHES processes PCIe AER error records, it allocates memory
for aer_capability_regs (entry.regs) from ghes_estatus_pool and queues the
entry into aer_recover_ring.
In aer_recover_work_func(), items are popped from aer_recover_ring via
kfifo_get(). If pci_get_domain_bus_and_slot() fails to find a matching
pci_dev, the code previously executed 'continue', bypassing the call to
ghes_estatus_pool_region_free(). As a result, the memory allocated for
entry.regs from ghes_estatus_pool was leaked.
This is reachable whenever the device reported by firmware is not (or is no
longer) present in the PCI device tree, e.g. after hot-removal or when
firmware reports an error for a device the kernel never enumerated.
Refactor aer_recover_work_func() to ensure ghes_estatus_pool_region_free()
is called unconditionally for every dequeued entry, releasing the pool
memory even when pci_dev is missing.
Fixes: e2abc47a5a1a ("ACPI: APEI: Fix AER info corruption when error status data has multiple sections")
Signed-off-by: Priyank Rathod <rathodpriyank@google.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260928-b4-fix-aer-memleaks-v5-2-ba6b94c9c9a6@google.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions
