Re: [PATCH] ACPI: APEI: EINJ: fix potential NULL dereference in __einj_error_inject
From: Yazen Ghannam
Date: Tue Aug 19 2025 - 10:09:58 EST
On Fri, Aug 15, 2025 at 10:42:06AM +0800, Charles Han wrote:
> 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: Yazen Ghannam <yazen.ghannam@xxxxxxx>
Thanks,
Yazen