summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans.h
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2012-11-27 21:36:54 +0200
committerJohannes Berg <johannes.berg@intel.com>2012-11-28 15:35:04 +0100
commitb4991f3f7bdc2402a3d7d841eb4376bda4f7a56b (patch)
treecc311c2240ac27055e4bacd76d3705e2a9aa7376 /drivers/net/wireless/iwlwifi/iwl-trans.h
parent52e2a99eee77cc4a47e183eb7f5102301a31e282 (diff)
downloadblackbird-op-linux-b4991f3f7bdc2402a3d7d841eb4376bda4f7a56b.tar.gz
blackbird-op-linux-b4991f3f7bdc2402a3d7d841eb4376bda4f7a56b.zip
iwlwifi: clear trans->op_mode pointer when it is leaving
Since the op_mode is leaving, the transport should set its pointer to it to NULL to not point to freed memory. 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/iwl-trans.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index e378ea6dca9c..98072c2067eb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -489,10 +489,6 @@ struct iwl_trans {
static inline void iwl_trans_configure(struct iwl_trans *trans,
const struct iwl_trans_config *trans_cfg)
{
- /*
- * only set the op_mode for the moment. Later on, this function will do
- * more
- */
trans->op_mode = trans_cfg->op_mode;
trans->ops->configure(trans, trans_cfg);
@@ -512,6 +508,9 @@ static inline void iwl_trans_stop_hw(struct iwl_trans *trans,
trans->ops->stop_hw(trans, op_mode_leaving);
+ if (op_mode_leaving)
+ trans->op_mode = NULL;
+
trans->state = IWL_TRANS_NO_FW;
}
OpenPOWER on IntegriCloud