svn commit: r313310 - head/sys/dev/iwm
Adrian Chadd
adrian at FreeBSD.org
Mon Feb 6 02:20:07 UTC 2017
Author: adrian
Date: Mon Feb 6 02:20:05 2017
New Revision: 313310
URL: https://svnweb.freebsd.org/changeset/base/313310
Log:
[iwm] make sure we call iwm_detach_local() only once.
Obtained from: DragonflyBSD git ebd4ceab76a6f161362029cbfd08efaedaab0519
Modified:
head/sys/dev/iwm/if_iwm.c
head/sys/dev/iwm/if_iwmvar.h
Modified: head/sys/dev/iwm/if_iwm.c
==============================================================================
--- head/sys/dev/iwm/if_iwm.c Mon Feb 6 02:14:34 2017 (r313309)
+++ head/sys/dev/iwm/if_iwm.c Mon Feb 6 02:20:05 2017 (r313310)
@@ -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, i
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);
Modified: head/sys/dev/iwm/if_iwmvar.h
==============================================================================
--- head/sys/dev/iwm/if_iwmvar.h Mon Feb 6 02:14:34 2017 (r313309)
+++ head/sys/dev/iwm/if_iwmvar.h Mon Feb 6 02:20:05 2017 (r313310)
@@ -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;
More information about the svn-src-all
mailing list