Skip to content

Commit 94a370f

Browse files
Wer-Wolfrafaeljw
authored andcommitted
ACPI: bus: Bail out if acpi_kobj registration fails
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]>
1 parent a5806cd commit 94a370f

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
@@ -1446,8 +1446,10 @@ static int __init acpi_init(void)
14461446
}
14471447

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

14521454
init_prmt();
14531455
acpi_init_pcc();

0 commit comments

Comments
 (0)