Skip to content

Commit

Permalink
iwlwifi: clear trans->op_mode pointer when it is leaving
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Emmanuel Grumbach authored and Johannes Berg committed Nov 28, 2012
1 parent 52e2a99 commit b4991f3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/wireless/iwlwifi/iwl-trans.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit b4991f3

Please sign in to comment.