Commit 561a10b6 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by Greg Kroah-Hartman

firmware: fix detecting error on register_reboot_notifier()

register_reboot_notifier() can fail, detect this and address this
failure. This has been broken since v3.11, however the chances of
this failing here is really low.

Fixes: fe304143 ("firmware: Avoid deadlock of usermodehelper lock at shutdown")
Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6bb9cf3a
......@@ -1860,8 +1860,15 @@ static int __init firmware_class_init(void)
if (ret)
return ret;
register_reboot_notifier(&fw_shutdown_nb);
ret = register_reboot_notifier(&fw_shutdown_nb);
if (ret)
goto out;
return register_sysfs_loader();
out:
unregister_fw_pm_ops();
return ret;
}
static void __exit firmware_class_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment