Commit fe4e1a57 authored by Hanjun Guo's avatar Hanjun Guo Committed by Rafael J. Wysocki

ACPI: watchdog: Put the watchdog action table after parsing

The mapped watchdog action table should be released after the
successfully parsing, and the failure path in the driver
initialization.
Signed-off-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent f8690227
...@@ -73,6 +73,7 @@ static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void) ...@@ -73,6 +73,7 @@ static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
} }
if (acpi_watchdog_uses_rtc(wdat)) { if (acpi_watchdog_uses_rtc(wdat)) {
acpi_put_table((struct acpi_table_header *)wdat);
pr_info("Skipping WDAT on this system because it uses RTC SRAM\n"); pr_info("Skipping WDAT on this system because it uses RTC SRAM\n");
return NULL; return NULL;
} }
...@@ -117,12 +118,12 @@ void __init acpi_watchdog_init(void) ...@@ -117,12 +118,12 @@ void __init acpi_watchdog_init(void)
/* Watchdog disabled by BIOS */ /* Watchdog disabled by BIOS */
if (!(wdat->flags & ACPI_WDAT_ENABLED)) if (!(wdat->flags & ACPI_WDAT_ENABLED))
return; goto fail_put_wdat;
/* Skip legacy PCI WDT devices */ /* Skip legacy PCI WDT devices */
if (wdat->pci_segment != 0xff || wdat->pci_bus != 0xff || if (wdat->pci_segment != 0xff || wdat->pci_bus != 0xff ||
wdat->pci_device != 0xff || wdat->pci_function != 0xff) wdat->pci_device != 0xff || wdat->pci_function != 0xff)
return; goto fail_put_wdat;
INIT_LIST_HEAD(&resource_list); INIT_LIST_HEAD(&resource_list);
...@@ -188,4 +189,6 @@ void __init acpi_watchdog_init(void) ...@@ -188,4 +189,6 @@ void __init acpi_watchdog_init(void)
fail_free_resource_list: fail_free_resource_list:
resource_list_free(&resource_list); resource_list_free(&resource_list);
fail_put_wdat:
acpi_put_table((struct acpi_table_header *)wdat);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment