.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * ACPI watchdog table parsing support. |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2016, Intel Corporation |
---|
5 | 6 | * 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. |
---|
10 | 7 | */ |
---|
11 | 8 | |
---|
12 | 9 | #define pr_fmt(fmt) "ACPI: watchdog: " fmt |
---|
.. | .. |
---|
76 | 73 | } |
---|
77 | 74 | |
---|
78 | 75 | if (acpi_watchdog_uses_rtc(wdat)) { |
---|
| 76 | + acpi_put_table((struct acpi_table_header *)wdat); |
---|
79 | 77 | pr_info("Skipping WDAT on this system because it uses RTC SRAM\n"); |
---|
80 | 78 | return NULL; |
---|
81 | 79 | } |
---|
.. | .. |
---|
120 | 118 | |
---|
121 | 119 | /* Watchdog disabled by BIOS */ |
---|
122 | 120 | if (!(wdat->flags & ACPI_WDAT_ENABLED)) |
---|
123 | | - return; |
---|
| 121 | + goto fail_put_wdat; |
---|
124 | 122 | |
---|
125 | 123 | /* Skip legacy PCI WDT devices */ |
---|
126 | 124 | if (wdat->pci_segment != 0xff || wdat->pci_bus != 0xff || |
---|
127 | 125 | wdat->pci_device != 0xff || wdat->pci_function != 0xff) |
---|
128 | | - return; |
---|
| 126 | + goto fail_put_wdat; |
---|
129 | 127 | |
---|
130 | 128 | INIT_LIST_HEAD(&resource_list); |
---|
131 | 129 | |
---|
.. | .. |
---|
191 | 189 | |
---|
192 | 190 | fail_free_resource_list: |
---|
193 | 191 | resource_list_free(&resource_list); |
---|
| 192 | +fail_put_wdat: |
---|
| 193 | + acpi_put_table((struct acpi_table_header *)wdat); |
---|
194 | 194 | } |
---|