summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorBing Zhao <bzhao@marvell.com>2013-03-07 20:00:16 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-28 12:06:02 -0700
commit23e90aa103cabff3b5d48faad3e8deefa43e38b6 (patch)
tree738e967ddaf2ef8062e7c4711433a23d69e464df /drivers/net
parent7bdb127976b88b761bdd0b2a2756b35681655ce1 (diff)
downloadlwn-23e90aa103cabff3b5d48faad3e8deefa43e38b6.tar.gz
lwn-23e90aa103cabff3b5d48faad3e8deefa43e38b6.zip
mwifiex: fix potential out-of-boundary access to ibss rate table
commit 5f0fabf84d7b52f979dcbafa3d3c530c60d9a92c upstream. 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. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net')
-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 5eab3dc29b1c..890841a46c60 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -1102,10 +1102,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 */