Skip to content

Commit 0fd0541

Browse files
ColinIanKingrafaeljw
authored andcommitted
ACPI: APEI: EINJ: Fix check and iounmap of uninitialized pointer p
In the case where a request_mem_region call fails and pointer r is null the error exit path via label 'out' will check for a non-null pointer p and try to iounmap it. However, pointer p has not been assigned a value at this point, so it may potentially contain any garbage value. Fix this by ensuring pointer p is initialized to NULL. Fixes: 1a35c88 ("ACPI: APEI: EINJ: Fix kernel test sparse warnings") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://patch.msgid.link/20250624202937.523013-1-colin.i.king@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent c13d38b commit 0fd0541

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/acpi/apei/einj-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type,
401401
u32 table_size;
402402
int rc = -EIO;
403403
struct acpi_generic_address *trigger_param_region = NULL;
404-
struct acpi_einj_trigger __iomem *p;
404+
struct acpi_einj_trigger __iomem *p = NULL;
405405

406406
r = request_mem_region(trigger_paddr, sizeof(trigger_tab),
407407
"APEI EINJ Trigger Table");

0 commit comments

Comments
 (0)