提交 03ba4a1b 编写于 作者: D Dan Carpenter 提交者: Kalle Valo

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 50d4d8fe
...@@ -5794,7 +5794,7 @@ static int airo_set_freq(struct net_device *dev, ...@@ -5794,7 +5794,7 @@ static int airo_set_freq(struct net_device *dev,
fwrq->m = ieee80211_frequency_to_channel(f); fwrq->m = ieee80211_frequency_to_channel(f);
} }
/* Setting by channel number */ /* Setting by channel number */
if((fwrq->m > 1000) || (fwrq->e > 0)) if (fwrq->m < 0 || fwrq->m > 1000 || fwrq->e > 0)
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
else { else {
int channel = fwrq->m; int channel = fwrq->m;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部