Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[platform/kernel/linux-rpi.git] / drivers / base / firmware_class.c
index 3719c94..26ab358 100644 (file)
@@ -534,6 +534,8 @@ static int _request_firmware(const struct firmware **firmware_p,
                return 0;
        }
 
+       read_lock_usermodehelper();
+
        if (WARN_ON(usermodehelper_is_disabled())) {
                dev_err(device, "firmware: %s will not be loaded\n", name);
                retval = -EBUSY;
@@ -572,6 +574,8 @@ static int _request_firmware(const struct firmware **firmware_p,
        fw_destroy_instance(fw_priv);
 
 out:
+       read_unlock_usermodehelper();
+
        if (retval) {
                release_firmware(firmware);
                *firmware_p = NULL;