From 031fc810abd6b2e6e7ca1c5dca1e30b0816a0558 Mon Sep 17 00:00:00 2001 From: Bill Paul 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/dev/dc/if_dc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev/dc') diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index a23706a2d802..a07c4dc4c934 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1770,6 +1770,9 @@ static int dc_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct dc_softc)); + mtx_init(&sc->dc_mtx, device_get_nameunit(dev), MTX_DEF); + DC_LOCK(sc); + /* * Handle power management nonsense. */ @@ -1833,8 +1836,6 @@ static int dc_attach(dev) goto fail; } - mtx_init(&sc->dc_mtx, device_get_nameunit(dev), MTX_DEF); - DC_LOCK(sc); /* Need this info to decide on a chip type. */ sc->dc_info = dc_devtype(dev); revision = pci_read_config(dev, DC_PCI_CFRV, 4) & 0x000000FF; -- cgit v1.3