diff options
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r-- | drivers/net/wireless/airo.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index c70604f0329e..8ce5e4cee168 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -5918,20 +5918,19 @@ static int airo_set_essid(struct net_device *dev, | |||
5918 | readSsidRid(local, &SSID_rid); | 5918 | readSsidRid(local, &SSID_rid); |
5919 | 5919 | ||
5920 | /* Check if we asked for `any' */ | 5920 | /* Check if we asked for `any' */ |
5921 | if(dwrq->flags == 0) { | 5921 | if (dwrq->flags == 0) { |
5922 | /* Just send an empty SSID list */ | 5922 | /* Just send an empty SSID list */ |
5923 | memset(&SSID_rid, 0, sizeof(SSID_rid)); | 5923 | memset(&SSID_rid, 0, sizeof(SSID_rid)); |
5924 | } else { | 5924 | } else { |
5925 | int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; | 5925 | unsigned index = (dwrq->flags & IW_ENCODE_INDEX) - 1; |
5926 | 5926 | ||
5927 | /* Check the size of the string */ | 5927 | /* Check the size of the string */ |
5928 | if(dwrq->length > IW_ESSID_MAX_SIZE) { | 5928 | if (dwrq->length > IW_ESSID_MAX_SIZE) |
5929 | return -E2BIG ; | 5929 | return -E2BIG ; |
5930 | } | 5930 | |
5931 | /* Check if index is valid */ | 5931 | /* Check if index is valid */ |
5932 | if((index < 0) || (index >= 4)) { | 5932 | if (index >= ARRAY_SIZE(SSID_rid.ssids)) |
5933 | return -EINVAL; | 5933 | return -EINVAL; |
5934 | } | ||
5935 | 5934 | ||
5936 | /* Set the SSID */ | 5935 | /* Set the SSID */ |
5937 | memset(SSID_rid.ssids[index].ssid, 0, | 5936 | memset(SSID_rid.ssids[index].ssid, 0, |
@@ -6819,7 +6818,7 @@ static int airo_set_txpow(struct net_device *dev, | |||
6819 | return -EINVAL; | 6818 | return -EINVAL; |
6820 | } | 6819 | } |
6821 | clear_bit (FLAG_RADIO_OFF, &local->flags); | 6820 | clear_bit (FLAG_RADIO_OFF, &local->flags); |
6822 | for (i = 0; cap_rid.txPowerLevels[i] && (i < 8); i++) | 6821 | for (i = 0; i < 8 && cap_rid.txPowerLevels[i]; i++) |
6823 | if (v == cap_rid.txPowerLevels[i]) { | 6822 | if (v == cap_rid.txPowerLevels[i]) { |
6824 | readConfigRid(local, 1); | 6823 | readConfigRid(local, 1); |
6825 | local->config.txPower = v; | 6824 | local->config.txPower = v; |