diff options
author | Luis R. Rodriguez <mcgrof@kernel.org> | 2017-11-20 09:45:34 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-29 11:07:00 +0100 |
commit | 561a10b6a15b531de359ccfc489488c733bb2821 (patch) | |
tree | ccac2a42a1a46fd34584ede08e1e2abc852c9fc5 /drivers/base/firmware_class.c | |
parent | 6bb9cf3aa3edf5968877d3f7863e232d4b9394a4 (diff) | |
download | op-kernel-dev-561a10b6a15b531de359ccfc489488c733bb2821.zip op-kernel-dev-561a10b6a15b531de359ccfc489488c733bb2821.tar.gz |
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: fe304143b0c3d ("firmware: Avoid deadlock of usermodehelper lock at shutdown")
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_class.c')
-rw-r--r-- | drivers/base/firmware_class.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 3340a17..7ab54f2 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -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) |