summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorScott Ashcroft <scott.ashcroft@talk21.com>2008-05-27 11:15:02 +0300
committerJohn W. Linville <linville@tuxdriver.com>2008-06-03 15:00:16 -0400
commit20ad4fd56255b455beb677dc097eb108d15f1d63 (patch)
tree52618a2c7b0948c631cd30f55a8bdfb616f86f2a /drivers/net
parenta888d52d1eda77f08e09d38ac829353200240716 (diff)
downloadlinux-20ad4fd56255b455beb677dc097eb108d15f1d63.tar.bz2
rndis_wlan: use ARRAY_SIZE instead of sizeof when adding 11g rates
While figuring out the TKIP problem I found a bug in the code which adds the 11g rates. It's using sizeof instead of ARRAY_SIZE to terminate the for loop. This makes it fall off the end of the rates array start into the frequency array instead. Running "iwlist rate" should show the problem as there will always be 32 rates with the last few being bogus. The following patch will fix it. Signed-off-by: Scott Ashcroft <scott.ashcroft@talk21.com> Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/rndis_wlan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index d0b1fb15c709..ed310f84f28b 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1108,7 +1108,7 @@ static int rndis_iw_get_range(struct net_device *dev,
/* fill in 802.11g rates */
if (has_80211g_rates) {
num = range->num_bitrates;
- for (i = 0; i < sizeof(rates_80211g); i++) {
+ for (i = 0; i < ARRAY_SIZE(rates_80211g); i++) {
for (j = 0; j < num; j++) {
if (range->bitrate[j] ==
rates_80211g[i] * 1000000)