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/dev/vr/if_vr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev/vr') diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index 38677fd..a1fa0c0 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -643,6 +643,9 @@ static int vr_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct vr_softc *)); + mtx_init(&sc->vr_mtx, device_get_nameunit(dev), MTX_DEF); + VR_LOCK(sc); + /* * Handle power management nonsense. */ @@ -728,8 +731,6 @@ static int vr_attach(dev) goto fail; } - mtx_init(&sc->vr_mtx, device_get_nameunit(dev), MTX_DEF); - VR_LOCK(sc); /* Reset the adapter. */ vr_reset(sc); -- cgit v1.1