summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBing Zhao <bzhao@marvell.com>2013-03-08 04:00:16 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2013-03-08 20:37:48 (GMT)
commit5f0fabf84d7b52f979dcbafa3d3c530c60d9a92c (patch)
tree5bcad5779eb68683ad464df885c1a5e7c6ea4a7d /drivers
parent930df2dfc7073c9ed2d0b47a08e47027ae83c545 (diff)
downloadlinux-5f0fabf84d7b52f979dcbafa3d3c530c60d9a92c.tar.xz
mwifiex: fix potential out-of-boundary access to ibss rate table
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: <stable@vger.kernel.org> # 3.0+ Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mwifiex/join.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 246aa62..2fe0ceb 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -1117,10 +1117,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 */