提交 b4991f3f 编写于 作者: E Emmanuel Grumbach 提交者: Johannes Berg

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: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 52e2a99e
...@@ -489,10 +489,6 @@ struct iwl_trans { ...@@ -489,10 +489,6 @@ struct iwl_trans {
static inline void iwl_trans_configure(struct iwl_trans *trans, static inline void iwl_trans_configure(struct iwl_trans *trans,
const struct iwl_trans_config *trans_cfg) 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->op_mode = trans_cfg->op_mode;
trans->ops->configure(trans, trans_cfg); trans->ops->configure(trans, trans_cfg);
...@@ -512,6 +508,9 @@ static inline void iwl_trans_stop_hw(struct iwl_trans *trans, ...@@ -512,6 +508,9 @@ static inline void iwl_trans_stop_hw(struct iwl_trans *trans,
trans->ops->stop_hw(trans, op_mode_leaving); trans->ops->stop_hw(trans, op_mode_leaving);
if (op_mode_leaving)
trans->op_mode = NULL;
trans->state = IWL_TRANS_NO_FW; trans->state = IWL_TRANS_NO_FW;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册