Skip to content

Commit 64887bb

Browse files
guohanjunrafaeljw
authored andcommitted
ACPI: ipmi: Remove address space handler in error path
The acpi_install_address_space_handler() is coupled with acpi_remove_address_space_handler() in ipmi module init/exit, but it forgets to remove the handler in acpi_ipmi_init() if the ipmi_smi_watcher_register() call fails, so add the removal of the address space handler in error path. Signed-off-by: Hanjun Guo <[email protected]> [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent f00d2d3 commit 64887bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/acpi/acpi_ipmi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,14 @@ static int __init acpi_ipmi_init(void)
597597
pr_warn("Can't register IPMI opregion space handle\n");
598598
return -EINVAL;
599599
}
600+
600601
result = ipmi_smi_watcher_register(&driver_data.bmc_events);
601-
if (result)
602+
if (result) {
603+
acpi_remove_address_space_handler(ACPI_ROOT_OBJECT,
604+
ACPI_ADR_SPACE_IPMI,
605+
&acpi_ipmi_space_handler);
602606
pr_err("Can't register IPMI system interface watcher\n");
607+
}
603608

604609
return result;
605610
}

0 commit comments

Comments
 (0)