RE: [PATCH] ACPI: APEI: Avoid NULL pointer dereference in ghes_estatus_pool_region_free

From: Jiawen Wu

Date: Tue Feb 03 2026 - 20:55:11 EST


On Tue, Feb 3, 2026 8:57 PM, Rafael J. Wysocki wrote:
> On Tue, Feb 3, 2026 at 3:14 AM Jiawen Wu <jiawenwu@xxxxxxxxxxxxxx> wrote:
> >
> > The function ghes_estatus_pool_region_free() is exported and be called
> > by the PCIe AER recovery path, which unconditionally invokes it to free
> > aer_capability_regs memory.
> >
> > Although current AER usage assumes memory comes from the GHES pool,
> > robustness requires guarding against pool unavailability. Add a NULL check
> > before calling gen_pool_free() to prevent crashes when the pool is not
> > initialized. This also makes the API safer for potential future use by
> > non-GHES callers.
>
> Are any such callers going to be added any time soon?

Yes, I want a ethernet driver to call aer_recover_queue().

>
> > Fixes: e2abc47a5a1a ("ACPI: APEI: Fix AER info corruption when error status data has multiple sections")
>
> It doesn't fix anything, the lack of the check is not an error
> currently, AFAICS.

So far, it seems.