summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2017-02-06 02:20:05 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2017-02-06 02:20:05 +0000
commit59e6427fbf35a1ce55ad044a25440b2859c69fb5 (patch)
treec4b39ed94ae2e29d14d8006fa39efe1ee61c1809
parent30a0fd92c9d60c03c6bdbb324fbceb228654984b (diff)
Notes
-rw-r--r--sys/dev/iwm/if_iwm.c5
-rw-r--r--sys/dev/iwm/if_iwmvar.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c
index 44aa28314247..05916a3d584a 100644
--- a/sys/dev/iwm/if_iwm.c
+++ b/sys/dev/iwm/if_iwm.c
@@ -5766,6 +5766,7 @@ iwm_attach(device_t dev)
int txq_i, i;
sc->sc_dev = dev;
+ sc->sc_attached = 1;
IWM_LOCK_INIT(sc);
mbufq_init(&sc->sc_snd, ifqmaxlen);
callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0);
@@ -6218,6 +6219,10 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211)
device_t dev = sc->sc_dev;
int i;
+ if (!sc->sc_attached)
+ return 0;
+ sc->sc_attached = 0;
+
if (do_net80211)
ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task);
diff --git a/sys/dev/iwm/if_iwmvar.h b/sys/dev/iwm/if_iwmvar.h
index 9d4f2fabe0f9..da530a7bf3c5 100644
--- a/sys/dev/iwm/if_iwmvar.h
+++ b/sys/dev/iwm/if_iwmvar.h
@@ -369,6 +369,7 @@ struct iwm_node {
struct iwm_softc {
device_t sc_dev;
uint32_t sc_debug;
+ int sc_attached;
struct mtx sc_mtx;
struct mbufq sc_snd;