Skip to content

Commit 0c2aac2

Browse files
Wer-Wolfsmb49
authored andcommitted
ACPI: bus: Bail out if acpi_kobj registration fails
BugLink: https://bugs.launchpad.net/bugs/2120812 [ Upstream commit 94a370fc8def6038dbc02199db9584b0b3690f1a ] 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 <W_Armin@gmx.de> Link: https://patch.msgid.link/20250518185111.3560-2-W_Armin@gmx.de Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Noah Wager <noah.wager@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 8e454a7 commit 0c2aac2

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)