Skip to content

Commit

Permalink
iwlwifi: mvm: avoid possible NULL pointer dereference
Browse files Browse the repository at this point in the history
When adding a PASN station, the station is added to the list only
if a TK is configured. Otherwise the station pointer should not be
used.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20201008180656.b8a493c168a7.Ie9a0f9dfd9e9c58c603dd06e45151119467a7804@changeid
  • Loading branch information
Avraham Stern authored and Kalle Valo committed Oct 8, 2020
1 parent 2c2c364 commit bebc14d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,18 +354,16 @@ int iwl_mvm_ftm_respoder_add_pasn_sta(struct iwl_mvm *mvm,
kfree(sta);
return ret;
}

memcpy(sta->addr, addr, ETH_ALEN);
list_add_tail(&sta->list, &mvm->resp_pasn_list);
}

ret = iwl_mvm_ftm_responder_dyn_cfg_v3(mvm, vif, NULL, &hltk_data);
if (ret) {
if (sta)
iwl_mvm_resp_del_pasn_sta(mvm, vif, sta);
return ret;
}
if (ret && sta)
iwl_mvm_resp_del_pasn_sta(mvm, vif, sta);

memcpy(sta->addr, addr, ETH_ALEN);
list_add_tail(&sta->list, &mvm->resp_pasn_list);
return 0;
return ret;
}

int iwl_mvm_ftm_resp_remove_pasn_sta(struct iwl_mvm *mvm,
Expand Down

0 comments on commit bebc14d

Please sign in to comment.