From 8959d55643de7a1447ede8f35c53c5efcda9ac24 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 16 Jul 2018 19:43:55 -0400 Subject: [PATCH] freebsd11_wlan: Sync previous ifdetach patch with FreeBSD. It was upstreamed, albeit in a slightly different location and with a different comment than I originally had. --- .../compat/freebsd11_wlan/net80211/ieee80211.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/libs/compat/freebsd11_wlan/net80211/ieee80211.c b/src/libs/compat/freebsd11_wlan/net80211/ieee80211.c index b4f38a77fb..88b9c5c646 100644 --- a/src/libs/compat/freebsd11_wlan/net80211/ieee80211.c +++ b/src/libs/compat/freebsd11_wlan/net80211/ieee80211.c @@ -362,16 +362,19 @@ ieee80211_ifdetach(struct ieee80211com *ic) { struct ieee80211vap *vap; + /* + * We use this as an indicator that ifattach never had a chance to be + * called, e.g. early driver attach failed and ifdetach was called + * during subsequent detach. Never fear, for we have nothing to do + * here. + */ + if (ic->ic_tq == NULL) + return; + mtx_lock(&ic_list_mtx); LIST_REMOVE(ic, ic_next); mtx_unlock(&ic_list_mtx); -#ifdef __HAIKU__ - /* Have we even initialized this com? */ - if (!ic->ic_tq) - return; -#endif - taskqueue_drain(taskqueue_thread, &ic->ic_restart_task); /*