From b8c91855f1fad4cf48d1ea06a08c873cf7cd3efb Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 24 Aug 2005 20:28:56 +0000 Subject: [PATCH] - Remove redundant assertions that the driver lock is not held in attach() and detach() since mtx_lock() will assert that already since the driver lock is not recursive. - Move the call to callout_init_mtx() before hme_stop() so that the callout_stop() in hme_stop() doesn't operate on an uninitialized callout structure during attach. Reported by: yongari (2) MFC after: 3 days --- sys/dev/hme/if_hme.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/dev/hme/if_hme.c b/sys/dev/hme/if_hme.c index 8ed71b164008..80237b37c59b 100644 --- a/sys/dev/hme/if_hme.c +++ b/sys/dev/hme/if_hme.c @@ -199,14 +199,13 @@ hme_config(struct hme_softc *sc) * */ - HME_LOCK_ASSERT(sc, MA_NOTOWNED); + callout_init_mtx(&sc->sc_tick_ch, &sc->sc_lock, 0); + /* Make sure the chip is stopped. */ HME_LOCK(sc); hme_stop(sc); HME_UNLOCK(sc); - callout_init_mtx(&sc->sc_tick_ch, &sc->sc_lock, 0); - /* * Allocate DMA capable memory * Buffer descriptors must be aligned on a 2048 byte boundary; @@ -381,8 +380,6 @@ hme_detach(struct hme_softc *sc) struct ifnet *ifp = sc->sc_ifp; int i; - HME_LOCK_ASSERT(sc, MA_NOTOWNED); - ether_ifdetach(ifp); if_free(ifp); HME_LOCK(sc);