summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/cisco
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-05-10 22:20:37 +0300
committerKalle Valo <kvalo@codeaurora.org>2016-05-11 22:01:38 +0300
commit03ba4a1b718e3a018f38f1ee030de4cd052bb3f3 (patch)
tree7c87a0dddb75a4bbf27a378542302963d1bc75d6 /drivers/net/wireless/cisco
parent50d4d8feb9133abb5b8fcb22c48ec509295fdc43 (diff)
downloadlinux-03ba4a1b718e3a018f38f1ee030de4cd052bb3f3.tar.xz
airo: prevent potential underflow in airo_set_freq()
I'm not sure if this can underflow but Smatch complains. It seems harmless to add a check for negatives. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/cisco')
-rw-r--r--drivers/net/wireless/cisco/airo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c
index 4bd9e2b97e86..833b46c5ed42 100644
--- a/drivers/net/wireless/cisco/airo.c
+++ b/drivers/net/wireless/cisco/airo.c
@@ -5794,7 +5794,7 @@ static int airo_set_freq(struct net_device *dev,
fwrq->m = ieee80211_frequency_to_channel(f);
}
/* Setting by channel number */
- if((fwrq->m > 1000) || (fwrq->e > 0))
+ if (fwrq->m < 0 || fwrq->m > 1000 || fwrq->e > 0)
rc = -EOPNOTSUPP;
else {
int channel = fwrq->m;