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
This commit is contained in:
Maksim Yevmenkin 2005-08-02 16:03:51 +00:00
parent 6fc6b69327
commit c20990577c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148639

View file

@ -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);