]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iwlwifi: don't WARN on host commands sent when firmware is dead
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 15 Sep 2013 08:37:17 +0000 (11:37 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 2 Oct 2013 09:25:38 +0000 (11:25 +0200)
This triggers automatic bug reports and add no valuable
information. Print a simple error instead and drop the
host command.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/iwl-trans.h

index dd57a36ecb1005d7571290a59925fd4d641b61aa..80b47508647ca8d5861f4b4c8dc8e8ec879d34c3 100644 (file)
@@ -601,8 +601,10 @@ static inline int iwl_trans_send_cmd(struct iwl_trans *trans,
 {
        int ret;
 
-       WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE,
-                 "%s bad state = %d", __func__, trans->state);
+       if (trans->state != IWL_TRANS_FW_ALIVE) {
+               IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
+               return -EIO;
+       }
 
        if (!(cmd->flags & CMD_ASYNC))
                lock_map_acquire_read(&trans->sync_cmd_lockdep_map);