[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220517095809.7791-1-ruc_gongyuanjun@163.com>
Date: Tue, 17 May 2022 17:58:09 +0800
From: Yuanjun Gong <ruc_gongyuanjun@....com>
To: Yuanjun Gong <ruc_gongyuanjun@....com>,
Larry Finger <Larry.Finger@...inger.net>,
linux-kernel@...r.kernel.org
Cc: stable@...r.kernel.org
Subject: [PATCH 1/1] staging: fix a potential infinite loop
From: Gong Yuanjun <ruc_gongyuanjun@....com>
In the for-loop in _rtl92e_update_rxcounts(),
i is a u8 counter while priv->rtllib->LinkDetectInfo.SlotNum is
a u16 num, there is a potential infinite loop if SlotNum is larger
than u8_max.
Change the u8 loop counter i into u16.
Signed-off-by: Gong Yuanjun <ruc_gongyuanjun@....com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index b9ce71848023..3c5082abc583 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1342,7 +1342,7 @@ static void _rtl92e_update_rxcounts(struct r8192_priv *priv, u32 *TotalRxBcnNum,
u32 *TotalRxDataNum)
{
u16 SlotIndex;
- u8 i;
+ u16 i;
*TotalRxBcnNum = 0;
*TotalRxDataNum = 0;
--
2.17.1
Powered by blists - more mailing lists