airo: prevent potential underflow in airo_set_freq()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
drivers/net/wireless/cisco/airo.c +1 -1
@@ -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;
Quoted 4 lines · Dan Carpenter
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 <[email protected]>
Thanks, 1 patch applied to wireless-drivers-next.git:
03ba4a1b718e airo: prevent potential underflow in airo_set_freq()
Signature · 2 lines
Sent by pwcli https://patchwork.kernel.org/patch/9061381/