avoid potential array index by -1
Noticed by: Coverity Prevent analysis tool
This commit is contained in:
parent
0ea8247d55
commit
9b7f94f833
@ -628,7 +628,8 @@ ieee80211_end_scan(struct ieee80211com *ic)
|
||||
bestchan = i;
|
||||
break;
|
||||
}
|
||||
if (maxrssi[i] < maxrssi[bestchan])
|
||||
if (bestchan == -1 ||
|
||||
maxrssi[i] < maxrssi[bestchan])
|
||||
bestchan = i;
|
||||
}
|
||||
if (bestchan != -1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user