summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_fpdt.c
diff options
context:
space:
mode:
authorJing Xiangfeng <jingxiangfeng@huawei.com>2021-06-02 13:58:12 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-06-07 16:00:38 +0200
commitdd9eaa23e72572d4f1c03f2e5d2e14a5b5793e79 (patch)
treef80f3a271f26d02df1b62c78faac91497013b67c /drivers/acpi/acpi_fpdt.c
parentACPI: tables: PPTT: Populate cache-id if provided by firmware (diff)
downloadlinux-dd9eaa23e72572d4f1c03f2e5d2e14a5b5793e79.tar.xz
linux-dd9eaa23e72572d4f1c03f2e5d2e14a5b5793e79.zip
ACPI: tables: FPDT: Add missing acpi_put_table() in acpi_init_fpdt()
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>
Diffstat (limited to 'drivers/acpi/acpi_fpdt.c')
-rw-r--r--drivers/acpi/acpi_fpdt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_fpdt.c b/drivers/acpi/acpi_fpdt.c
index a89a806a7a2a..4ee2ad234e3d 100644
--- a/drivers/acpi/acpi_fpdt.c
+++ b/drivers/acpi/acpi_fpdt.c
@@ -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;