summaryrefslogtreecommitdiffstats
path: root/sys/dev/ti
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-12-04 22:46:50 +0000
committerwpaul <wpaul@FreeBSD.org>2000-12-04 22:46:50 +0000
commit9e208c7442e565fc1de970045410945e52702467 (patch)
tree3933565b0c0070018517c21c29b3ccc39d115ccb /sys/dev/ti
parente01a4c0fd9aff88ae8d9b70d8f82aaf56c9c9116 (diff)
downloadFreeBSD-src-9e208c7442e565fc1de970045410945e52702467.zip
FreeBSD-src-9e208c7442e565fc1de970045410945e52702467.tar.gz
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.
Diffstat (limited to 'sys/dev/ti')
-rw-r--r--sys/dev/ti/if_ti.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c
index 1a88f0d..7f6660f 100644
--- a/sys/dev/ti/if_ti.c
+++ b/sys/dev/ti/if_ti.c
@@ -1476,6 +1476,9 @@ static int ti_attach(dev)
unit = device_get_unit(dev);
bzero(sc, sizeof(struct ti_softc));
+ mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_DEF);
+ TI_LOCK(sc);
+
/*
* Map control/status registers.
*/
@@ -1527,9 +1530,6 @@ static int ti_attach(dev)
goto fail;
}
- mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_DEF);
- TI_LOCK(sc);
-
sc->ti_unit = unit;
if (ti_chipinit(sc)) {
OpenPOWER on IntegriCloud