From 954947ea9cd2591eec2bc4404d0daf2ab15eb5b1 Mon Sep 17 00:00:00 2001 From: Quyunfei Date: Wed, 10 May 2023 06:39:06 +0000 Subject: [PATCH] Fix a NULL pointer. drivers inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I71T4L CVE: NA Reference: N/A ------------------------------------------------------------- Fixed an issue with using a pointer without verifying that the pointer is not null Signed-off-by: Quyunfei --- drivers/acpi/acpi_extlog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index 560fdae8cc59..703bfb87d36d 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -310,9 +310,11 @@ static void __exit extlog_exit(void) { edac_set_report_status(old_edac_report_status); mce_unregister_decode_chain(&extlog_mce_dec); - ((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN; - if (extlog_l1_addr) + if (extlog_l1_addr) { + ((struct extlog_l1_head *)extlog_l1_addr)->flags + &= ~FLAG_OS_OPTIN; acpi_os_unmap_iomem(extlog_l1_addr, l1_size); + } if (elog_addr) acpi_os_unmap_iomem(elog_addr, elog_size); release_mem_region(elog_base, elog_size); -- Gitee