From 9e208c7442e565fc1de970045410945e52702467 Mon Sep 17 00:00:00 2001 From: wpaul Date: Mon, 4 Dec 2000 22:46:50 +0000 Subject: Initialize/grab the mutex earlier in the attach phase, so that bailing out to the fail: label where we release/destroy the mutex will work without exploding. --- sys/pci/if_sf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/pci/if_sf.c') diff --git a/sys/pci/if_sf.c b/sys/pci/if_sf.c index f2ca1e8..aa33e7d 100644 --- a/sys/pci/if_sf.c +++ b/sys/pci/if_sf.c @@ -679,6 +679,8 @@ static int sf_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct sf_softc)); + mtx_init(&sc->sf_mtx, device_get_nameunit(dev), MTX_DEF); + SF_LOCK(sc); /* * Handle power management nonsense. */ @@ -765,8 +767,6 @@ static int sf_attach(dev) } callout_handle_init(&sc->sf_stat_ch); - mtx_init(&sc->sf_mtx, device_get_nameunit(dev), MTX_DEF); - SF_LOCK(sc); /* Reset the adapter. */ sf_reset(sc); -- cgit v1.1