From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: gregkh@linuxfoundation.org
Cc: keescook@chromium.org, mfuzzey@parkeon.com,
zohar@linux.vnet.ibm.com, dhowells@redhat.com,
pali.rohar@gmail.com, tiwai@suse.de,
arend.vanspriel@broadcom.com, zajec5@gmail.com, nbroeking@me.com,
markivx@codeaurora.org, stephen.boyd@linaro.org,
broonie@kernel.org, dmitry.torokhov@gmail.com,
dwmw2@infradead.org, torvalds@linux-foundation.org,
Abhay_Salunke@dell.com, bjorn.andersson@linaro.org,
jewalt@lgsinnovations.com, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
"Luis R. Rodriguez" <mcgrof@kernel.org>
Subject: [PATCH 4/5] firmware: fix detecting error on register_reboot_notifier()
Date: Mon, 20 Nov 2017 09:45:34 -0800 [thread overview]
Message-ID: <20171120174535.27000-5-mcgrof@kernel.org> (raw)
In-Reply-To: <20171120174535.27000-1-mcgrof@kernel.org>
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>
---
drivers/base/firmware_class.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 3340a17e0499..7ab54f2b032f 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)
--
2.15.0
next prev parent reply other threads:[~2017-11-20 17:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 17:45 [PATCH 0/5] firmware: few fixes for v4.15 Luis R. Rodriguez
2017-11-20 17:45 ` [PATCH 1/5] firmware: add helper to unregister pm ops Luis R. Rodriguez
2017-11-20 17:45 ` [PATCH 2/5] firmware: fix capturing errors on fw_cache_init() on early init Luis R. Rodriguez
2017-11-20 17:45 ` [PATCH 3/5] firmware: provide helpers for registering the syfs loader Luis R. Rodriguez
2017-11-20 17:45 ` Luis R. Rodriguez [this message]
2017-11-20 17:45 ` [PATCH 5/5] test_firmware: fix setting old custom fw path back on exit Luis R. Rodriguez
2017-11-29 10:07 ` [PATCH 0/5] firmware: few fixes for v4.15 Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171120174535.27000-5-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=Abhay_Salunke@dell.com \
--cc=arend.vanspriel@broadcom.com \
--cc=bjorn.andersson@linaro.org \
--cc=broonie@kernel.org \
--cc=dhowells@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=gregkh@linuxfoundation.org \
--cc=jewalt@lgsinnovations.com \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markivx@codeaurora.org \
--cc=mfuzzey@parkeon.com \
--cc=nbroeking@me.com \
--cc=pali.rohar@gmail.com \
--cc=stephen.boyd@linaro.org \
--cc=tiwai@suse.de \
--cc=torvalds@linux-foundation.org \
--cc=zajec5@gmail.com \
--cc=zohar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.