diff options
author | wpaul <wpaul@FreeBSD.org> | 2000-12-04 22:46:50 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2000-12-04 22:46:50 +0000 |
commit | 9e208c7442e565fc1de970045410945e52702467 (patch) | |
tree | 3933565b0c0070018517c21c29b3ccc39d115ccb /sys/dev/sk | |
parent | e01a4c0fd9aff88ae8d9b70d8f82aaf56c9c9116 (diff) | |
download | FreeBSD-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/sk')
-rw-r--r-- | sys/dev/sk/if_sk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index befe974..143c4e4 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -1194,6 +1194,9 @@ static int sk_attach(dev) unit = device_get_unit(dev); bzero(sc, sizeof(struct sk_softc)); + mtx_init(&sc->sk_mtx, device_get_nameunit(dev), MTX_DEF); + SK_LOCK(sc); + /* * Handle power management nonsense. */ @@ -1279,8 +1282,6 @@ static int sk_attach(dev) goto fail; } - mtx_init(&sc->sk_mtx, device_get_nameunit(dev), MTX_DEF); - SK_LOCK(sc); /* Reset the adapter. */ sk_reset(sc); |