Skip to content

Commit 03c902b

Browse files
jmberg-intellucacoelho
authored andcommitted
iwlwifi: mvm: avoid crash on restart w/o reserved queues
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: 8d98ae6 ("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>
1 parent 7941c59 commit 03c902b

File tree

1 file changed

+4
-3
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+4
-3
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/sta.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,9 +1164,10 @@ static void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm,
11641164
.frame_limit = IWL_FRAME_LIMIT,
11651165
};
11661166

1167-
/* Make sure reserved queue is still marked as such (or allocated) */
1168-
mvm->queue_info[mvm_sta->reserved_queue].status =
1169-
IWL_MVM_QUEUE_RESERVED;
1167+
/* Make sure reserved queue is still marked as such (if allocated) */
1168+
if (mvm_sta->reserved_queue != IEEE80211_INVAL_HW_QUEUE)
1169+
mvm->queue_info[mvm_sta->reserved_queue].status =
1170+
IWL_MVM_QUEUE_RESERVED;
11701171

11711172
for (i = 0; i <= IWL_MAX_TID_COUNT; i++) {
11721173
struct iwl_mvm_tid_data *tid_data = &mvm_sta->tid_data[i];

0 commit comments

Comments
 (0)