RE: [PATCH] ACPI: APEI: EINJ: fix potential NULL dereference in __einj_error_inject

From: Luck, Tony
Date: Fri Aug 15 2025 - 11:53:15 EST


> The __einj_error_inject() function allocates memory via kmalloc()
> without checking for allocation failure, which could lead to a
> NULL pointer dereference.
>
> Return -ENOMEM in case allocation fails.
>
> Fixes: b47610296d17 ("ACPI: APEI: EINJ: Enable EINJv2 error injections")
> Signed-off-by: Charles Han <hanchunchao@xxxxxxxxxx>

Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>

-Tony