Re: [PATCH v3 2/2] PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing
[email protected] Mon, 03 Aug 2026 22:01:19 +0000
| Newsgroups | org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <[email protected]> |
> 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. >=20 > 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. >=20 > 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. >=20 > Signed-off-by: Priyank Rathod <[email protected]> Sashiko has reviewed this patch and found no issues. It looks great! --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260803-b4-fix-aer= [email protected]?part=3D2