From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-Id: <20130411202552.873042948@goodmis.org> Date: Thu, 11 Apr 2013 16:25:44 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bing Zhao , "John W. Linville" Subject: [ 041/171 ] mwifiex: fix potential out-of-boundary access to ibss rate table References: <20130411202503.783159048@goodmis.org> Content-Disposition: inline; filename=0041-mwifiex-fix-potential-out-of-boundary-access-to-ibss.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.2 stable review patch. If anyone has any objections, please let me know. ------------------ From: Bing Zhao [ Upstream commit 5f0fabf84d7b52f979dcbafa3d3c530c60d9a92c ] smatch found this error: CHECK drivers/net/wireless/mwifiex/join.c drivers/net/wireless/mwifiex/join.c:1121 mwifiex_cmd_802_11_ad_hoc_join() error: testing array offset 'i' after use. Cc: # 3.0+ Signed-off-by: Bing Zhao Signed-off-by: John W. Linville Signed-off-by: Steven Rostedt --- drivers/net/wireless/mwifiex/join.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index 82e63ce..fa42578 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c @@ -1093,10 +1093,9 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, adhoc_join->bss_descriptor.bssid, adhoc_join->bss_descriptor.ssid); - for (i = 0; bss_desc->supported_rates[i] && - i < MWIFIEX_SUPPORTED_RATES; - i++) - ; + for (i = 0; i < MWIFIEX_SUPPORTED_RATES && + bss_desc->supported_rates[i]; i++) + ; rates_size = i; /* Copy Data Rates from the Rates recorded in scan response */ -- 1.7.10.4