Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5212cd67 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Matthew Garrett
Browse files

WMI: remove EC region handler when _WDG parsing fails



Driver initialization was forgetting to remove EC address space handler
in cases when parse_wdg() method failed.

Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent ac9b1e5b
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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;
	}