Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Mar 2018 05:40:00 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r330164 - stable/11/sys/dev/iwm
Message-ID:  <201803010540.w215e0qX026555@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803010540.w215e0qX026555>