In rtw_pci_shutdown(), hold serializer before calling rtw_stop()
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 1 Dec 2006 07:52:30 +0000 (07:52 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 1 Dec 2006 07:52:30 +0000 (07:52 +0000)
sys/dev/netif/rtw/if_rtw_pci.c

index fc0e85b..663eb7e 100644 (file)
@@ -32,7 +32,7 @@
  * SUCH DAMAGE.
  *
  * $NetBSD: if_rtw_pci.c,v 1.4 2005/12/04 17:44:02 christos Exp $
- * $DragonFly: src/sys/dev/netif/rtw/if_rtw_pci.c,v 1.2 2006/10/25 20:55:58 dillon Exp $
+ * $DragonFly: src/sys/dev/netif/rtw/if_rtw_pci.c,v 1.3 2006/12/01 07:52:30 sephe Exp $
  */
 
 /*
@@ -253,6 +253,11 @@ rtw_pci_detach(device_t dev)
 static int
 rtw_pci_shutdown(device_t dev)
 {
-       rtw_stop(device_get_softc(dev), 1);
+       struct rtw_softc *sc = device_get_softc(dev);
+       struct ifnet *ifp = &sc->sc_ic.ic_if;
+
+       lwkt_serialize_enter(ifp->if_serializer);
+       rtw_stop(sc, 1);
+       lwkt_serialize_exit(ifp->if_serializer);
        return 0;
 }