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_wb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/pci/if_wb.c') diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c index bb93b3f..19893cf 100644 --- a/sys/pci/if_wb.c +++ b/sys/pci/if_wb.c @@ -817,6 +817,9 @@ static int wb_attach(dev) sc = device_get_softc(dev); unit = device_get_unit(dev); + mtx_init(&sc->wb_mtx, device_get_nameunit(dev), MTX_DEF); + WB_LOCK(sc); + /* * Handle power management nonsense. */ @@ -906,9 +909,6 @@ static int wb_attach(dev) /* Save the cache line size. */ sc->wb_cachesize = pci_read_config(dev, WB_PCI_CACHELEN, 4) & 0xFF; - mtx_init(&sc->wb_mtx, device_get_nameunit(dev), MTX_DEF); - WB_LOCK(sc); - /* Reset the adapter. */ wb_reset(sc); -- cgit v1.1