diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-12-02 06:03:36 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-09 02:08:29 -0500 |
commit | 40add19d3897dda97086ec7a73cf4e8daf7c00ee (patch) | |
tree | 9de6b994c7375fab76632cdce8cfe8ccb3a76982 /drivers/net/wireless/intel | |
parent | 97663735a96f0cd7c851bbb8f08cff66d617220c (diff) |
iwlwifi: mvm: avoid crash on restart w/o reserved queues
commit 03c902bff524e0cf664737a33f2365f7837040bf upstream.
When the firmware restarts in a situation in which any station
has no queue reserved anymore because that queue was used, the
code will crash trying to access the queue_info array at the
offset 255, which is far too big. Fix this by checking that a
queue is actually reserved before writing its status.
Fixes: 8d98ae6eb0d5 ("iwlwifi: mvm: re-assign old queues after hw restart in dqa mode")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/wireless/intel')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index fc771885e383..52de3c6d760c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c | |||
@@ -1144,9 +1144,10 @@ static void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm, | |||
1144 | .frame_limit = IWL_FRAME_LIMIT, | 1144 | .frame_limit = IWL_FRAME_LIMIT, |
1145 | }; | 1145 | }; |
1146 | 1146 | ||
1147 | /* Make sure reserved queue is still marked as such (or allocated) */ | 1147 | /* Make sure reserved queue is still marked as such (if allocated) */ |
1148 | mvm->queue_info[mvm_sta->reserved_queue].status = | 1148 | if (mvm_sta->reserved_queue != IEEE80211_INVAL_HW_QUEUE) |
1149 | IWL_MVM_QUEUE_RESERVED; | 1149 | mvm->queue_info[mvm_sta->reserved_queue].status = |
1150 | IWL_MVM_QUEUE_RESERVED; | ||
1150 | 1151 | ||
1151 | for (i = 0; i <= IWL_MAX_TID_COUNT; i++) { | 1152 | for (i = 0; i <= IWL_MAX_TID_COUNT; i++) { |
1152 | struct iwl_mvm_tid_data *tid_data = &mvm_sta->tid_data[i]; | 1153 | struct iwl_mvm_tid_data *tid_data = &mvm_sta->tid_data[i]; |