提交 08340585 编写于 作者: C Colin Ian King 提交者: Zheng Zengkai

staging: rtl8192u: Fix potential infinite loop

stable inclusion
from stable-5.10.37
commit 40d622b31bafc64a83f0992f7be2e90576f950e7
bugzilla: 51868
CVE: NA

--------------------------------

[ Upstream commit f9b9263a ]

The for-loop iterates with a u8 loop counter i and compares this
with the loop upper limit of riv->ieee80211->LinkDetectInfo.SlotNum
that is a u16 type. There is a potential infinite loop if SlotNum
is larger than the u8 loop counter. Fix this by making the loop
counter the same type as SlotNum.

Addresses-Coverity: ("Infinite loop")
Fixes: 8fc8598e ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210407150308.496623-1-colin.king@canonical.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 2c0056aa
...@@ -3208,7 +3208,7 @@ static void rtl819x_update_rxcounts(struct r8192_priv *priv, u32 *TotalRxBcnNum, ...@@ -3208,7 +3208,7 @@ static void rtl819x_update_rxcounts(struct r8192_priv *priv, u32 *TotalRxBcnNum,
u32 *TotalRxDataNum) u32 *TotalRxDataNum)
{ {
u16 SlotIndex; u16 SlotIndex;
u8 i; u16 i;
*TotalRxBcnNum = 0; *TotalRxBcnNum = 0;
*TotalRxDataNum = 0; *TotalRxDataNum = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册