Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <guohanjun@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Hanjun Guo and committed by
Rafael J. Wysocki
fe4e1a57 f8690227

+5 -2
+5 -2
drivers/acpi/acpi_watchdog.c
··· 73 73 } 74 74 75 75 if (acpi_watchdog_uses_rtc(wdat)) { 76 + acpi_put_table((struct acpi_table_header *)wdat); 76 77 pr_info("Skipping WDAT on this system because it uses RTC SRAM\n"); 77 78 return NULL; 78 79 } ··· 118 117 119 118 /* Watchdog disabled by BIOS */ 120 119 if (!(wdat->flags & ACPI_WDAT_ENABLED)) 121 - return; 120 + goto fail_put_wdat; 122 121 123 122 /* Skip legacy PCI WDT devices */ 124 123 if (wdat->pci_segment != 0xff || wdat->pci_bus != 0xff || 125 124 wdat->pci_device != 0xff || wdat->pci_function != 0xff) 126 - return; 125 + goto fail_put_wdat; 127 126 128 127 INIT_LIST_HEAD(&resource_list); 129 128 ··· 189 188 190 189 fail_free_resource_list: 191 190 resource_list_free(&resource_list); 191 + fail_put_wdat: 192 + acpi_put_table((struct acpi_table_header *)wdat); 192 193 }