--- l/drivers/base/firmware_loader/fallback.c +++ f/drivers/base/firmware_loader/fallback.c @@ -83,15 +83,15 @@ static int fw_load_sysfs_fallback(struct dev_set_uevent_suppress(f_dev, true); + mutex_lock(&fw_lock); + retval = device_add(f_dev); if (retval) { dev_err(f_dev, "%s: device_register failed\n", __func__); goto err_put_dev; } - mutex_lock(&fw_lock); if (fw_load_abort_all || fw_state_is_aborted(fw_priv)) { - mutex_unlock(&fw_lock); retval = -EINTR; goto out; } @@ -120,10 +120,12 @@ static int fw_load_sysfs_fallback(struct } else if (fw_priv->is_paged_buf && !fw_priv->data) retval = -ENOMEM; + mutex_lock(&fw_lock); out: device_del(f_dev); err_put_dev: put_device(f_dev); + mutex_unlock(&fw_lock); return retval; } --- l/drivers/base/firmware_loader/sysfs.c +++ s/drivers/base/firmware_loader/sysfs.c @@ -81,10 +81,8 @@ static int firmware_uevent(const struct const struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev); int err = 0; - mutex_lock(&fw_lock); if (fw_sysfs->fw_priv) err = do_firmware_uevent(fw_sysfs, env); - mutex_unlock(&fw_lock); return err; } #endif /* CONFIG_FW_LOADER_USER_HELPER */