aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rndis_wlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rndis_wlan.c')
-rw-r--r--drivers/net/wireless/rndis_wlan.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index a0ad8e781dd3..a36d2c85e26e 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -640,8 +640,7 @@ static void dsconfig_to_freq(unsigned int dsconfig, struct iw_freq *freq)
640static int freq_to_dsconfig(struct iw_freq *freq, unsigned int *dsconfig) 640static int freq_to_dsconfig(struct iw_freq *freq, unsigned int *dsconfig)
641{ 641{
642 if (freq->m < 1000 && freq->e == 0) { 642 if (freq->m < 1000 && freq->e == 0) {
643 if (freq->m >= 1 && 643 if (freq->m >= 1 && freq->m <= ARRAY_SIZE(freq_chan))
644 freq->m <= (sizeof(freq_chan) / sizeof(freq_chan[0])))
645 *dsconfig = freq_chan[freq->m - 1] * 1000; 644 *dsconfig = freq_chan[freq->m - 1] * 1000;
646 else 645 else
647 return -1; 646 return -1;
@@ -1179,10 +1178,9 @@ static int rndis_iw_get_range(struct net_device *dev,
1179 range->throughput = 11 * 1000 * 1000 / 2; 1178 range->throughput = 11 * 1000 * 1000 / 2;
1180 } 1179 }
1181 1180
1182 range->num_channels = (sizeof(freq_chan)/sizeof(freq_chan[0])); 1181 range->num_channels = ARRAY_SIZE(freq_chan);
1183 1182
1184 for (i = 0; i < (sizeof(freq_chan)/sizeof(freq_chan[0])) && 1183 for (i = 0; i < ARRAY_SIZE(freq_chan) && i < IW_MAX_FREQUENCIES; i++) {
1185 i < IW_MAX_FREQUENCIES; i++) {
1186 range->freq[i].i = i + 1; 1184 range->freq[i].i = i + 1;
1187 range->freq[i].m = freq_chan[i] * 100000; 1185 range->freq[i].m = freq_chan[i] * 100000;
1188 range->freq[i].e = 1; 1186 range->freq[i].e = 1;