summaryrefslogtreecommitdiffstats
path: root/drivers/base/firmware_class.c
diff options
context:
space:
mode:
authorAnton Vorontsov <cbouatmailru@gmail.com>2011-11-25 02:49:45 +0400
committerAnton Vorontsov <cbouatmailru@gmail.com>2011-11-25 02:54:59 +0400
commit47f0ac2b0a8c7f26b513a2a18045219b030aedf1 (patch)
tree27f33a5c1e40ee2a494758c1da2e03e86a09e32c /drivers/base/firmware_class.c
parent7925231037447d1a9036f31c823d362bf2ef4bb0 (diff)
parentc3b92c8787367a8bb53d57d9789b558f1295cc96 (diff)
Merge tag 'v3.1' from git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git into master
Battery tree missed last merge window, so it became stale enough so that patches no longer apply as people use pretty recent kernels.
Diffstat (limited to 'drivers/base/firmware_class.c')
-rw-r--r--drivers/base/firmware_class.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index bbb03e6f725..06ed6b4e7df 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -521,11 +521,6 @@ static int _request_firmware(const struct firmware **firmware_p,
if (!firmware_p)
return -EINVAL;
- if (WARN_ON(usermodehelper_is_disabled())) {
- dev_err(device, "firmware: %s will not be loaded\n", name);
- return -EBUSY;
- }
-
*firmware_p = firmware = kzalloc(sizeof(*firmware), GFP_KERNEL);
if (!firmware) {
dev_err(device, "%s: kmalloc(struct firmware) failed\n",
@@ -539,6 +534,12 @@ static int _request_firmware(const struct firmware **firmware_p,
return 0;
}
+ if (WARN_ON(usermodehelper_is_disabled())) {
+ dev_err(device, "firmware: %s will not be loaded\n", name);
+ retval = -EBUSY;
+ goto out;
+ }
+
if (uevent)
dev_dbg(device, "firmware: requesting %s\n", name);