public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: mwifiex: Fix a loop in mwifiex_update_ampdu_rxwinsize()
@ 2026-01-08 20:00 Dan Carpenter
  2026-01-08 20:58 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2026-01-08 20:00 UTC (permalink / raw)
  To: Chunfan Chen
  Cc: Brian Norris, Francesco Dolcini, Kalle Valo, Amitkumar Karwar,
	Cathy Luo, linux-wireless, linux-kernel, kernel-janitors

The "i" iterator variable is used to count two different things but
unfortunately we can't store two different numbers in the same variable.
Use "i" for the outside loop and "j" for the inside loop.

Cc: stable@vger.kernel.org
Fixes: d219b7eb3792 ("mwifiex: handle BT coex event to adjust Rx BA window size")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
This was found via static analysis so I'm not positive on the impact
of this bug.

 drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c b/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
index 90831a1350f5..91166b89f918 100644
--- a/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
@@ -826,7 +826,7 @@ void mwifiex_update_rxreor_flags(struct mwifiex_adapter *adapter, u8 flags)
 static void mwifiex_update_ampdu_rxwinsize(struct mwifiex_adapter *adapter,
 					   bool coex_flag)
 {
-	u8 i;
+	u8 i, j;
 	u32 rx_win_size;
 	struct mwifiex_private *priv;
 
@@ -864,8 +864,8 @@ static void mwifiex_update_ampdu_rxwinsize(struct mwifiex_adapter *adapter,
 		if (rx_win_size != priv->add_ba_param.rx_win_size) {
 			if (!priv->media_connected)
 				continue;
-			for (i = 0; i < MAX_NUM_TID; i++)
-				mwifiex_11n_delba(priv, i);
+			for (j = 0; j < MAX_NUM_TID; j++)
+				mwifiex_11n_delba(priv, j);
 		}
 	}
 }
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-12  8:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 20:00 [PATCH] wifi: mwifiex: Fix a loop in mwifiex_update_ampdu_rxwinsize() Dan Carpenter
2026-01-08 20:58 ` Johannes Berg
2026-01-12  8:02   ` Jeff Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox