Skip to content

Commit ead7ba1

Browse files
guohanjunrafaeljw
authored andcommitted
ACPI: scan: Put SPCR and STAO table after using it
The SPCR and STAO table needs to be released after using it. Signed-off-by: Hanjun Guo <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent f900bf4 commit ead7ba1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/acpi/scan.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,10 +2157,13 @@ static void __init acpi_get_spcr_uart_addr(void)
21572157

21582158
status = acpi_get_table(ACPI_SIG_SPCR, 0,
21592159
(struct acpi_table_header **)&spcr_ptr);
2160-
if (ACPI_SUCCESS(status))
2161-
spcr_uart_addr = spcr_ptr->serial_port.address;
2162-
else
2163-
printk(KERN_WARNING PREFIX "STAO table present, but SPCR is missing\n");
2160+
if (ACPI_FAILURE(status)) {
2161+
pr_warn(PREFIX "STAO table present, but SPCR is missing\n");
2162+
return;
2163+
}
2164+
2165+
spcr_uart_addr = spcr_ptr->serial_port.address;
2166+
acpi_put_table((struct acpi_table_header *)spcr_ptr);
21642167
}
21652168

21662169
static bool acpi_scan_initialized;
@@ -2196,10 +2199,12 @@ int __init acpi_scan_init(void)
21962199
(struct acpi_table_header **)&stao_ptr);
21972200
if (ACPI_SUCCESS(status)) {
21982201
if (stao_ptr->header.length > sizeof(struct acpi_table_stao))
2199-
printk(KERN_INFO PREFIX "STAO Name List not yet supported.");
2202+
pr_info(PREFIX "STAO Name List not yet supported.\n");
22002203

22012204
if (stao_ptr->ignore_uart)
22022205
acpi_get_spcr_uart_addr();
2206+
2207+
acpi_put_table((struct acpi_table_header *)stao_ptr);
22032208
}
22042209

22052210
acpi_gpe_apply_masked_gpes();

0 commit comments

Comments
 (0)