Skip to content

Commit f9684c1

Browse files
jwrdegoedeSeth Forshee
authored andcommitted
platform/x86: dell-wmi-sysman: Make sysman_init() return -ENODEV of the interfaces are not found
BugLink: https://bugs.launchpad.net/bugs/1922601 [ Upstream commit 32418dd ] When either the attributes or the password interface is not found, then unregister the 2 wmi drivers again and return -ENODEV from sysman_init(). Fixes: e8a60aa ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems") Cc: Divya Bharathi <Divya_Bharathi@dell.com> Cc: Mario Limonciello <mario.limonciello@dell.com> Reported-by: Alexander Naumann <alexandernaumann@gmx.de> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210321115901.35072-7-hdegoede@redhat.com Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
1 parent 545896e commit f9684c1

File tree

1 file changed

+7
-5
lines changed
  • drivers/platform/x86/dell-wmi-sysman

1 file changed

+7
-5
lines changed

drivers/platform/x86/dell-wmi-sysman/sysman.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,15 +506,17 @@ static int __init sysman_init(void)
506506
}
507507

508508
ret = init_bios_attr_set_interface();
509-
if (ret || !wmi_priv.bios_attr_wdev) {
510-
pr_debug("failed to initialize set interface\n");
509+
if (ret)
511510
return ret;
512-
}
513511

514512
ret = init_bios_attr_pass_interface();
515-
if (ret || !wmi_priv.password_attr_wdev) {
516-
pr_debug("failed to initialize pass interface\n");
513+
if (ret)
517514
goto err_exit_bios_attr_set_interface;
515+
516+
if (!wmi_priv.bios_attr_wdev || !wmi_priv.password_attr_wdev) {
517+
pr_debug("failed to find set or pass interface\n");
518+
ret = -ENODEV;
519+
goto err_exit_bios_attr_pass_interface;
518520
}
519521

520522
ret = class_register(&firmware_attributes_class);

0 commit comments

Comments
 (0)