Skip to content

Commit 4ac7a81

Browse files
guohanjunrafaeljw
authored andcommitted
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 <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 9b64560 commit 4ac7a81

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/acpi/bus.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ static int __init acpi_init(void)
13301330

13311331
result = acpi_bus_init();
13321332
if (result) {
1333+
kobject_put(acpi_kobj);
13331334
disable_acpi();
13341335
return result;
13351336
}

0 commit comments

Comments
 (0)