- Move ether_ifdetach earlier.

- Drain callouts after ether_ifdetach.

Suggested by:	jhb
This commit is contained in:
Benno Rice 2008-06-17 05:48:42 +00:00
parent 74572e9e63
commit aec9f8e993
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179837

View File

@ -394,6 +394,13 @@ smc_detach(device_t dev)
smc_stop(sc);
SMC_UNLOCK(sc);
if (sc->smc_ifp != NULL) {
ether_ifdetach(sc->smc_ifp);
}
callout_drain(&sc->smc_watchdog);
callout_drain(&sc->smc_mii_tick_ch);
#ifdef DEVICE_POLLING
if (sc->smc_ifp->if_capenable & IFCAP_POLLING)
ether_poll_deregister(sc->smc_ifp);
@ -409,10 +416,8 @@ smc_detach(device_t dev)
taskqueue_free(sc->smc_tq);
sc->smc_tq = NULL;
}
if (sc->smc_ifp != NULL) {
ether_ifdetach(sc->smc_ifp);
if_free(sc->smc_ifp);
}