diff options
author | Sharon Dvir <sharon.dvir@intel.com> | 2017-02-21 03:41:31 -0500 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2017-04-25 08:17:58 -0400 |
commit | e3df1e4b51e5e54637355db7d732fedf271530e7 (patch) | |
tree | daa81ab72ab3229589750f438eb032aa4d82bd35 | |
parent | 8c5f47b15c5c1537c000e3a4c92c82c5bbf521a4 (diff) |
iwlwifi: mvm: check if returned value is NULL
While freeing inactive queue, check mvmsta to be valid before
dereferencing it. Found by Klocwork.
Signed-off-by: Sharon Dvir <sharon.dvir@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index a2a1fa06b781..fc6d854b04b6 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c | |||
@@ -495,6 +495,8 @@ static int iwl_mvm_free_inactive_queue(struct iwl_mvm *mvm, int queue, | |||
495 | spin_unlock_bh(&mvm->queue_info_lock); | 495 | spin_unlock_bh(&mvm->queue_info_lock); |
496 | 496 | ||
497 | mvmsta = iwl_mvm_sta_from_staid_protected(mvm, sta_id); | 497 | mvmsta = iwl_mvm_sta_from_staid_protected(mvm, sta_id); |
498 | if (WARN_ON(!mvmsta)) | ||
499 | return -EINVAL; | ||
498 | 500 | ||
499 | disable_agg_tids = iwl_mvm_remove_sta_queue_marking(mvm, queue); | 501 | disable_agg_tids = iwl_mvm_remove_sta_queue_marking(mvm, queue); |
500 | /* Disable the queue */ | 502 | /* Disable the queue */ |