Author: eadler Date: Thu Mar 1 05:40:00 2018 New Revision: 330164 URL: https://svnweb.freebsd.org/changeset/base/330164
Log: MFC r313310: [iwm] make sure we call iwm_detach_local() only once. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:09:49 2018 (r330163) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:40:00 2018 (r330164) @@ -5743,6 +5743,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); @@ -6193,6 +6194,10 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 struct iwm_fw_info *fw = &sc->sc_fw; 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: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:09:49 2018 (r330163) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:40:00 2018 (r330164) @@ -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; _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"