Commit 4ac7a817 authored by Hanjun Guo's avatar Hanjun Guo Committed by Rafael J. Wysocki

ACPI: bus: Call kobject_put() in acpi_init() error path

Although the system will not be in a good condition or it will not
boot if acpi_bus_init() fails, it is still necessary to put the
kobject in the error path before returning to avoid leaking memory.
Signed-off-by: default avatarHanjun Guo <guohanjun@huawei.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9b645601
...@@ -1330,6 +1330,7 @@ static int __init acpi_init(void) ...@@ -1330,6 +1330,7 @@ static int __init acpi_init(void)
result = acpi_bus_init(); result = acpi_bus_init();
if (result) { if (result) {
kobject_put(acpi_kobj);
disable_acpi(); disable_acpi();
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment