net80211: fix possible panic when wlan(4) interface is destroyed.

If this is the last running vap wait until device will be powered off
(fixes panic when 'ifconfig wlan0 destroy' is executed for running iwn(4)
interface).

Tested with:
 - Intel 6205, STA mode.
 - RTL8188EU, STA / IBSS modes.
 - RTL8821AU, STA / HOSTAP modes.
This commit is contained in:
Andriy Voskoboinyk 2017-03-24 22:29:51 +00:00
parent 4e501eb7cc
commit e2db307ebc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315917

View File

@ -728,6 +728,7 @@ ieee80211_vap_detach(struct ieee80211vap *vap)
ieee80211_draintask(ic, &vap->iv_nstate_task);
ieee80211_draintask(ic, &vap->iv_swbmiss_task);
ieee80211_draintask(ic, &vap->iv_wme_task);
ieee80211_draintask(ic, &ic->ic_parent_task);
/* XXX band-aid until ifnet handles this for us */
taskqueue_drain(taskqueue_swi, &ifp->if_linktask);