diff options
author | emax <emax@FreeBSD.org> | 2005-08-02 16:03:51 +0000 |
---|---|---|
committer | emax <emax@FreeBSD.org> | 2005-08-02 16:03:51 +0000 |
commit | 854872e4864a2e7881301bacacefe152e8748cf3 (patch) | |
tree | 35b8ae076ef0b34e38d754110bd9b960beaae520 /sys/dev/an/if_an.c | |
parent | a41814db5e50449ff23e98a015c50ddf6f8c679b (diff) | |
download | FreeBSD-src-854872e4864a2e7881301bacacefe152e8748cf3.zip FreeBSD-src-854872e4864a2e7881301bacacefe152e8748cf3.tar.gz |
Do not lock an to check gone flag. Only need to hold the lock to set
the gone flag.
Reviewed by: imp
MFC after: 1 day
Diffstat (limited to 'sys/dev/an/if_an.c')
-rw-r--r-- | sys/dev/an/if_an.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index eade4e1..9e04e3b 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -826,12 +826,11 @@ an_detach(device_t dev) struct an_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->an_ifp; - AN_LOCK(sc); if (sc->an_gone) { - AN_UNLOCK(sc); device_printf(dev,"already unloaded\n"); return(0); } + AN_LOCK(sc); an_stop(sc); sc->an_gone = 1; ifmedia_removeall(&sc->an_ifmedia); |