Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03ba4a1b authored by Dan Carpenter's avatar Dan Carpenter Committed by Kalle Valo
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 50d4d8fe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;