ACPI: APEI: Put the HEST table for error path
authorHanjun Guo <guohanjun@huawei.com>
Thu, 7 May 2020 09:09:18 +0000 (17:09 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 9 May 2020 09:29:17 +0000 (11:29 +0200)
hest_tab will be used after hest_init(), but we need to release
it for error path.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/apei/hest.c

index 8224024..953a2fa 100644 (file)
@@ -243,8 +243,8 @@ void __init acpi_hest_init(void)
        } else if (ACPI_FAILURE(status)) {
                const char *msg = acpi_format_exception(status);
                pr_err(HEST_PFX "Failed to get table, %s\n", msg);
-               rc = -EINVAL;
-               goto err;
+               hest_disable = HEST_DISABLED;
+               return;
        }
 
        rc = apei_hest_parse(hest_parse_cmc, NULL);
@@ -266,4 +266,5 @@ void __init acpi_hest_init(void)
        return;
 err:
        hest_disable = HEST_DISABLED;
+       acpi_put_table((struct acpi_table_header *)hest_tab);
 }