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_sis.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/pci/if_sis.c') diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c index d59c99c..8f9b4d6 100644 --- a/sys/pci/if_sis.c +++ b/sys/pci/if_sis.c @@ -638,6 +638,9 @@ static int sis_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct sis_softc)); + mtx_init(&sc->sis_mtx, device_get_nameunit(dev), MTX_DEF); + SIS_LOCK(sc); + if (pci_get_device(dev) == SIS_DEVICEID_900) sc->sis_type = SIS_TYPE_900; if (pci_get_device(dev) == SIS_DEVICEID_7016) @@ -731,9 +734,6 @@ static int sis_attach(dev) goto fail; } - mtx_init(&sc->sis_mtx, device_get_nameunit(dev), MTX_DEF); - SIS_LOCK(sc); - /* Reset the adapter. */ sis_reset(sc); -- cgit v1.1