Skip to content

Commit

Permalink
WMI: remove EC region handler when _WDG parsing fails
Browse files Browse the repository at this point in the history
Driver initialization was forgetting to remove EC address space handler
in cases when parse_wdg() method failed.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
  • Loading branch information
Dmitry Torokhov authored and Matthew Garrett committed Oct 21, 2010
1 parent ac9b1e5 commit 5212cd6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/platform/x86/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,12 +956,17 @@ static int acpi_wmi_add(struct acpi_device *device)
ACPI_ADR_SPACE_EC,
&acpi_wmi_ec_space_handler,
NULL, NULL);
if (ACPI_FAILURE(status))
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Error installing EC region handler\n");
return -ENODEV;
}

status = parse_wdg(device->handle);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Error installing EC region handler\n");
acpi_remove_address_space_handler(device->handle,
ACPI_ADR_SPACE_EC,
&acpi_wmi_ec_space_handler);
printk(KERN_ERR PREFIX "Failed to parse WDG method\n");
return -ENODEV;
}

Expand Down

0 comments on commit 5212cd6

Please sign in to comment.