hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/acpi/acpi_watchdog.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * ACPI watchdog table parsing support.
34 *
45 * Copyright (C) 2016, Intel Corporation
56 * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #define pr_fmt(fmt) "ACPI: watchdog: " fmt
....@@ -76,6 +73,7 @@
7673 }
7774
7875 if (acpi_watchdog_uses_rtc(wdat)) {
76
+ acpi_put_table((struct acpi_table_header *)wdat);
7977 pr_info("Skipping WDAT on this system because it uses RTC SRAM\n");
8078 return NULL;
8179 }
....@@ -120,12 +118,12 @@
120118
121119 /* Watchdog disabled by BIOS */
122120 if (!(wdat->flags & ACPI_WDAT_ENABLED))
123
- return;
121
+ goto fail_put_wdat;
124122
125123 /* Skip legacy PCI WDT devices */
126124 if (wdat->pci_segment != 0xff || wdat->pci_bus != 0xff ||
127125 wdat->pci_device != 0xff || wdat->pci_function != 0xff)
128
- return;
126
+ goto fail_put_wdat;
129127
130128 INIT_LIST_HEAD(&resource_list);
131129
....@@ -191,4 +189,6 @@
191189
192190 fail_free_resource_list:
193191 resource_list_free(&resource_list);
192
+fail_put_wdat:
193
+ acpi_put_table((struct acpi_table_header *)wdat);
194194 }