projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50d4d8f
)
airo: prevent potential underflow in airo_set_freq()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Tue, 10 May 2016 19:20:37 +0000
(22:20 +0300)
committer
Kalle Valo
<kvalo@codeaurora.org>
Wed, 11 May 2016 19:01:38 +0000
(22:01 +0300)
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>
drivers/net/wireless/cisco/airo.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/wireless/cisco/airo.c
b/drivers/net/wireless/cisco/airo.c
index 4bd9e2b97e860e6e02e0bca0a98986d4bc80eb3d..833b46c5ed42b5c5d8c7d91048995973998a30a3 100644
(file)
--- 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;