aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-drv.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-drv.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c
index 67c9668d2e37..80898bb808b5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -899,7 +899,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
899 899
900 /* We have our copies now, allow OS release its copies */ 900 /* We have our copies now, allow OS release its copies */
901 release_firmware(ucode_raw); 901 release_firmware(ucode_raw);
902 complete(&drv->request_firmware_complete);
903 902
904 mutex_lock(&iwlwifi_opmode_table_mtx); 903 mutex_lock(&iwlwifi_opmode_table_mtx);
905 op = &iwlwifi_opmode_table[DVM_OP_MODE]; 904 op = &iwlwifi_opmode_table[DVM_OP_MODE];
@@ -910,11 +909,20 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
910 if (op->ops) { 909 if (op->ops) {
911 const struct iwl_op_mode_ops *ops = op->ops; 910 const struct iwl_op_mode_ops *ops = op->ops;
912 drv->op_mode = ops->start(drv->trans, drv->cfg, &drv->fw); 911 drv->op_mode = ops->start(drv->trans, drv->cfg, &drv->fw);
912
913 if (!drv->op_mode)
914 goto out_unbind;
913 } else { 915 } else {
914 request_module_nowait("%s", op->name); 916 request_module_nowait("%s", op->name);
915 } 917 }
916 mutex_unlock(&iwlwifi_opmode_table_mtx); 918 mutex_unlock(&iwlwifi_opmode_table_mtx);
917 919
920 /*
921 * Complete the firmware request last so that
922 * a driver unbind (stop) doesn't run while we
923 * are doing the start() above.
924 */
925 complete(&drv->request_firmware_complete);
918 return; 926 return;
919 927
920 try_again: 928 try_again: