summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-04-10 10:32:58 +0200
committerLuca Coelho <luciano.coelho@intel.com>2017-06-22 23:12:59 +0200
commit0ec971fdaddfcab72e5104e35774f489991f1f68 (patch)
treec13780b1cacf93a6d4a8cfc6d37d43e90d5dda6d /drivers/net/wireless/intel/iwlwifi/iwl-trans.c
parentiwlwifi: mvm: remove txq EMPTYING_DELBA state for DQA (diff)
downloadlinux-0ec971fdaddfcab72e5104e35774f489991f1f68.tar.xz
linux-0ec971fdaddfcab72e5104e35774f489991f1f68.zip
iwlwifi: remove resp_pkt NULL checks
Contrary to what some of the comments say, if rfkill was asserted the transport will return -ERFKILL instead of success, if CMD_WANT_SKB was set, so it's not necessary to check cmd.resp_pkt for being NULL if the return code was success. Validate that this is true in iwl_trans_send_cmd(). Most of the other code modifications were done with the following spatch: @@ struct iwl_host_cmd cmd; identifier pkt; @@ <... ( pkt = cmd.resp_pkt; ... -if (!pkt) { ... } | pkt = cmd.resp_pkt; ... -if (WARN_ON(!pkt)) { ... } | -if (!cmd.resp_pkt) { ... } ) ...> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/iwl-trans.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/iwl-trans.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
index c0871f8f2c68..dcf596217d9e 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
@@ -143,6 +143,9 @@ int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
if (!(cmd->flags & CMD_ASYNC))
lock_map_release(&trans->sync_cmd_lockdep_map);
+ if (WARN_ON((cmd->flags & CMD_WANT_SKB) && !ret && !cmd->resp_pkt))
+ return -EIO;
+
return ret;
}
IWL_EXPORT_SYMBOL(iwl_trans_send_cmd);