summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-04-07 16:03:08 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-22 10:59:30 +0200
commitc031062d3530612474deb0e0efb05bdb57471b61 (patch)
tree1b2d9fe7d4773a68e67e950c45fcdb9a67cd63f8 /drivers/staging
parentf1dfa84c8f26d6bf372df85837ae0d7fbbc127a9 (diff)
downloadlinux-stable-c031062d3530612474deb0e0efb05bdb57471b61.tar.gz
linux-stable-c031062d3530612474deb0e0efb05bdb57471b61.tar.bz2
linux-stable-c031062d3530612474deb0e0efb05bdb57471b61.zip
staging: rtl8192u: Fix potential infinite loop
[ Upstream commit f9b9263a25dc3d2eaaa829e207434db6951ca7bc ] 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: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210407150308.496623-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8192u/r8192U_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 87244a208976..cc12e6c36fed 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -3379,7 +3379,7 @@ static void rtl819x_update_rxcounts(struct r8192_priv *priv, u32 *TotalRxBcnNum,
u32 *TotalRxDataNum)
{
u16 SlotIndex;
- u8 i;
+ u16 i;
*TotalRxBcnNum = 0;
*TotalRxDataNum = 0;