diff options
author | avos <avos@FreeBSD.org> | 2016-02-28 23:35:03 +0000 |
---|---|---|
committer | avos <avos@FreeBSD.org> | 2016-02-28 23:35:03 +0000 |
commit | e4f93d9c2b04fb1358a1791394b30f1fddbb1c61 (patch) | |
tree | 6e91e729cfcefa601b96c827ceb3faba37b24cc4 /sys/net80211/ieee80211_ioctl.c | |
parent | 9a483696a28534144a3dc6dbf7b151619d99951b (diff) | |
download | FreeBSD-src-e4f93d9c2b04fb1358a1791394b30f1fddbb1c61.zip FreeBSD-src-e4f93d9c2b04fb1358a1791394b30f1fddbb1c61.tar.gz |
net80211: fix 'taskqueue_drain with non-sleepable locks held' warning
Do not run ieee80211_waitfor_parent() when it's not needed.
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5446
Diffstat (limited to 'sys/net80211/ieee80211_ioctl.c')
-rw-r--r-- | sys/net80211/ieee80211_ioctl.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index bdaac48..359b1d8 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -3289,7 +3289,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; - int error = 0; + int error = 0, wait = 0; struct ifreq *ifr; struct ifaddr *ifa; /* XXX */ @@ -3308,18 +3308,24 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * then it will automatically be brought up as a * side-effect of bringing ourself up. */ - if (vap->iv_state == IEEE80211_S_INIT) + if (vap->iv_state == IEEE80211_S_INIT) { + if (ic->ic_nrunning == 0) + wait = 1; ieee80211_start_locked(vap); + } } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* * Stop ourself. If we are the last vap to be * marked down the parent will also be taken down. */ + if (ic->ic_nrunning == 1) + wait = 1; ieee80211_stop_locked(vap); } IEEE80211_UNLOCK(ic); /* Wait for parent ioctl handler if it was queued */ - ieee80211_waitfor_parent(ic); + if (wait) + ieee80211_waitfor_parent(ic); break; case SIOCADDMULTI: case SIOCDELMULTI: |