lkml.org 
[lkml]   [2021]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] rsi: fix array out of bound
Date
Limit the max of 'ii'. If 'ii' greater than or
equal to 'RSI_MAX_VIFS', the array 'adapter->vifs'
may be out of bound

Signed-off-by: zhangyue <zhangyue1@kylinos.cn>
---
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index e70c1c7fdf59..913e11fb3807 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -1108,6 +1108,9 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,
break;
}

+ if (ii >= RSI_MAX_VIFS)
+ return status;
+
mutex_lock(&common->mutex);

if (ssn != NULL)
--
2.30.0
\
 
 \ /
  Last update: 2021-12-09 01:57    [W:0.036 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site