Skip to contentSkip to conversation

wifi: mwifiex: fix loop iterator in mwifiex_update_ampdu_txwinsize()

PATCH In review Dan Carpenter 2 participants 2 messages Feb 6, 2023 – Feb 13, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mwifiex: fix loop iterator in mwifiex_update_ampdu_txwinsize()

This code re-uses "i" to be the iterator for both the inside and outside loops. It means the outside loop will exit earlier than intended.

Fixes d219b7eb3792 ("mwifiex: handle BT coex event to adjust Rx BA window size")
---
 drivers/net/wireless/marvell/mwifiex/11n.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/marvell/mwifiex/11n.c +3 -3
index 4af57e6d4393..90e401100898 100644
@@ -878,7 +878,7 @@ mwifiex_send_delba_txbastream_tbl(struct mwifiex_private *priv, u8 tid)
  */
 void mwifiex_update_ampdu_txwinsize(struct mwifiex_adapter *adapter)
 {
-	u8 i;
+	u8 i, j;
 	u32 tx_win_size;
 	struct mwifiex_private *priv;
 
@@ -909,8 +909,8 @@ void mwifiex_update_ampdu_txwinsize(struct mwifiex_adapter *adapter)
 		if (tx_win_size != priv->add_ba_param.tx_win_size) {
 			if (!priv->media_connected)
 				continue;
-			for (i = 0; i < MAX_NUM_TID; i++)
-				mwifiex_send_delba_txbastream_tbl(priv, i);
+			for (j = 0; j < MAX_NUM_TID; j++)
+				mwifiex_send_delba_txbastream_tbl(priv, j);
 		}
 	}
 }
Signature · 1 line
2.35.1
#1 lore raw
Quoted 5 lines · Dan Carpenter

This code re-uses "i" to be the iterator for both the inside and outside loops. It means the outside loop will exit earlier than intended.

Fixes d219b7eb3792 ("mwifiex: handle BT coex event to adjust Rx BA window size")

Patch applied to wireless-next.git, thanks.

3cfb7df24cee wifi: mwifiex: fix loop iterator in mwifiex_update_ampdu_txwinsize()

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/Y+ERnaDaZD7RtLvX@kili/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches