ACPI: tables: FPDT: Add missing acpi_put_table() in acpi_init_fpdt()
authorJing Xiangfeng <jingxiangfeng@huawei.com>
Wed, 2 Jun 2021 11:58:12 +0000 (19:58 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 7 Jun 2021 14:00:38 +0000 (16:00 +0200)
acpi_init_fpdt() forgets to call acpi_put_table() in an error path.

Add the missing function call to fix it.

Fixes: d1eb86e59be0 ("ACPI: tables: introduce support for FPDT table")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_fpdt.c

index a89a806..4ee2ad2 100644 (file)
@@ -240,8 +240,10 @@ static int __init acpi_init_fpdt(void)
                return 0;
 
        fpdt_kobj = kobject_create_and_add("fpdt", acpi_kobj);
-       if (!fpdt_kobj)
+       if (!fpdt_kobj) {
+               acpi_put_table(header);
                return -ENOMEM;
+       }
 
        while (offset < header->length) {
                subtable = (void *)header + offset;