Skip to content

Commit fe4e1a5

Browse files
guohanjunrafaeljw
authored andcommitted
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: Hanjun Guo <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent f869022 commit fe4e1a5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/acpi/acpi_watchdog.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
7373
}
7474

7575
if (acpi_watchdog_uses_rtc(wdat)) {
76+
acpi_put_table((struct acpi_table_header *)wdat);
7677
pr_info("Skipping WDAT on this system because it uses RTC SRAM\n");
7778
return NULL;
7879
}
@@ -117,12 +118,12 @@ void __init acpi_watchdog_init(void)
117118

118119
/* Watchdog disabled by BIOS */
119120
if (!(wdat->flags & ACPI_WDAT_ENABLED))
120-
return;
121+
goto fail_put_wdat;
121122

122123
/* Skip legacy PCI WDT devices */
123124
if (wdat->pci_segment != 0xff || wdat->pci_bus != 0xff ||
124125
wdat->pci_device != 0xff || wdat->pci_function != 0xff)
125-
return;
126+
goto fail_put_wdat;
126127

127128
INIT_LIST_HEAD(&resource_list);
128129

@@ -188,4 +189,6 @@ void __init acpi_watchdog_init(void)
188189

189190
fail_free_resource_list:
190191
resource_list_free(&resource_list);
192+
fail_put_wdat:
193+
acpi_put_table((struct acpi_table_header *)wdat);
191194
}

0 commit comments

Comments
 (0)