Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hanjun Guo and committed by
Rafael J. Wysocki
4ac7a817 9b645601

+1
+1
drivers/acpi/bus.c
··· 1330 1330 1331 1331 result = acpi_bus_init(); 1332 1332 if (result) { 1333 + kobject_put(acpi_kobj); 1333 1334 disable_acpi(); 1334 1335 return result; 1335 1336 }