We dereference extlog_l1_addr before checking if is NULL. It turns out "extlog_l1_addr" pointer can never be NULL when this function is called so I have removed the check. We can remove the "elog_addr" check as well. Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> --- v2: remove the elog_addr check as well. diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index a6869e1..17da458 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -310,10 +310,8 @@ static void __exit extlog_exit(void) { mce_unregister_decode_chain(&extlog_mce_dec); ((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN; - if (extlog_l1_addr) - acpi_os_unmap_memory(extlog_l1_addr, l1_size); - if (elog_addr) - acpi_os_unmap_memory(elog_addr, elog_size); + acpi_os_unmap_memory(extlog_l1_addr, l1_size); + acpi_os_unmap_memory(elog_addr, elog_size); release_mem_region(elog_base, elog_size); release_mem_region(l1_dirbase, l1_size); kfree(elog_buf); -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html