Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Feb 2017 02:20:05 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r313310 - head/sys/dev/iwm
Message-ID:  <201702060220.v162K5JH006183@repo.freebsd.org>

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



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