diff options
author | sam <sam@FreeBSD.org> | 2008-09-27 21:18:40 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-09-27 21:18:40 +0000 |
commit | ab8d709f77fd6b269f9682dbb68f1130c14d112b (patch) | |
tree | e8c85ac79e4b242dec984b453c33746293a51a2c /sys/net80211/ieee80211_scan_sta.c | |
parent | 42ef15f1c440ff74dd63cf17378671e2c69f7e7b (diff) | |
download | FreeBSD-src-ab8d709f77fd6b269f9682dbb68f1130c14d112b.zip FreeBSD-src-ab8d709f77fd6b269f9682dbb68f1130c14d112b.tar.gz |
guard against adhoc_pick_channel returning a NULL channel; this can
happen after a scan cache flush (e.g. in response to ifconfig wlan bssid -)
Diffstat (limited to 'sys/net80211/ieee80211_scan_sta.c')
-rw-r--r-- | sys/net80211/ieee80211_scan_sta.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c index d1dc060..6b5bf88 100644 --- a/sys/net80211/ieee80211_scan_sta.c +++ b/sys/net80211/ieee80211_scan_sta.c @@ -1392,9 +1392,12 @@ notfound: */ if (vap->iv_des_chan == IEEE80211_CHAN_ANYC || IEEE80211_IS_CHAN_RADAR(vap->iv_des_chan)) { - chan = ieee80211_ht_adjust_channel(vap->iv_ic, - adhoc_pick_channel(ss, 0), - vap->iv_flags_ext); + struct ieee80211com *ic = vap->iv_ic; + + chan = adhoc_pick_channel(ss, 0); + if (chan != NULL) + chan = ieee80211_ht_adjust_channel(ic, + chan, vap->iv_flags_ext); } else chan = vap->iv_des_chan; if (chan != NULL) { |