Skip to content

Commit

Permalink
ACPI: tables: FPDT: Add missing acpi_put_table() in acpi_init_fpdt()
Browse files Browse the repository at this point in the history
[ Upstream commit dd9eaa2 ]

acpi_init_fpdt() forgets to call acpi_put_table() in an error path.

Add the missing function call to fix it.

Fixes: d1eb86e ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
hiss2018 authored and gregkh committed Jul 14, 2021
1 parent 620f58c commit 942511d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/acpi/acpi_fpdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 942511d

Please sign in to comment.