summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/dvm/lib.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2013-01-31 17:03:55 +0400
committerJohannes Berg <johannes.berg@intel.com>2013-03-20 15:10:57 +0400
commit2d5d50ee596361566f7f84300117cba7d7672bc5 (patch)
treeb9006f547092838143a54615dceae9c0680e2156 /drivers/net/wireless/iwlwifi/dvm/lib.c
parent4620020b5d7ca34d1c03fa98b0ca457320cb7d71 (diff)
downloadlinux-2d5d50ee596361566f7f84300117cba7d7672bc5.tar.xz
iwlwifi: dvm: don't send HCMD in restart flow
There is a race between the restart flow and the workers. The workers are cancelled after the fw is already killed and might send HCMD when there is fw to handle them. Simply check that there is a fw to which the HCMD can be sent before actually sending it. Cc: stable@vger.kernel.org Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/dvm/lib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/lib.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/lib.c b/drivers/net/wireless/iwlwifi/dvm/lib.c
index 86ea5f4c3939..44ca0e57f9f7 100644
--- a/drivers/net/wireless/iwlwifi/dvm/lib.c
+++ b/drivers/net/wireless/iwlwifi/dvm/lib.c
@@ -1262,6 +1262,15 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
}
/*
+ * This can happen upon FW ASSERT: we clear the STATUS_FW_ERROR flag
+ * in iwl_down but cancel the workers only later.
+ */
+ if (!priv->ucode_loaded) {
+ IWL_ERR(priv, "Fw not loaded - dropping CMD: %x\n", cmd->id);
+ return -EIO;
+ }
+
+ /*
* Synchronous commands from this op-mode must hold
* the mutex, this ensures we don't try to send two
* (or more) synchronous commands at a time.