]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ACPI: APEI: EINJ: fix potential NULL dereference in __einj_error_inject()
authorCharles Han <hanchunchao@inspur.com>
Fri, 15 Aug 2025 02:42:06 +0000 (10:42 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 18 Aug 2025 16:10:15 +0000 (18:10 +0200)
commit7459e87ae1d78ba27b728172fa2aa912a5b8640d
tree5582251b792b40c556e00b14194ccf77ef79a0e7
parent6c705851499172c0ce863e816946fb5a564ff69f
ACPI: APEI: EINJ: fix potential NULL dereference in __einj_error_inject()

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@inspur.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Link: https://patch.msgid.link/20250815024207.3038-1-hanchunchao@inspur.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/apei/einj-core.c