mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
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: Hanjun Guo <guohanjun@huawei.com> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
9b64560134
commit
4ac7a817f1
|
|
@ -1330,6 +1330,7 @@ static int __init acpi_init(void)
|
|||
|
||||
result = acpi_bus_init();
|
||||
if (result) {
|
||||
kobject_put(acpi_kobj);
|
||||
disable_acpi();
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user