Skip to content

Commit b01a29a

Browse files
Wer-Wolfgregkh
authored andcommitted
ACPI: bus: Bail out if acpi_kobj registration fails
[ Upstream commit 94a370f ] The ACPI sysfs code will fail to initialize if acpi_kobj is NULL, together with some ACPI drivers. Follow the other firmware subsystems and bail out if the kobject cannot be registered. Signed-off-by: Armin Wolf <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 7fe1b93 commit b01a29a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/acpi/bus.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,8 +1444,10 @@ static int __init acpi_init(void)
14441444
}
14451445

14461446
acpi_kobj = kobject_create_and_add("acpi", firmware_kobj);
1447-
if (!acpi_kobj)
1448-
pr_debug("%s: kset create error\n", __func__);
1447+
if (!acpi_kobj) {
1448+
pr_err("Failed to register kobject\n");
1449+
return -ENOMEM;
1450+
}
14491451

14501452
init_prmt();
14511453
acpi_init_pcc();

0 commit comments

Comments
 (0)