diff options
author | Bill Paul <wpaul@FreeBSD.org> | 2000-12-04 22:46:50 +0000 |
---|---|---|
committer | Bill Paul <wpaul@FreeBSD.org> | 2000-12-04 22:46:50 +0000 |
commit | 031fc810abd6b2e6e7ca1c5dca1e30b0816a0558 (patch) | |
tree | 666e0b4d2fded5ac285854eee39002f92f92a93a /sys/pci/if_sk.c | |
parent | b884490bc006964586812376b22661a7c18fa136 (diff) | |
download | src-031fc810abd6b2e6e7ca1c5dca1e30b0816a0558.tar.gz src-031fc810abd6b2e6e7ca1c5dca1e30b0816a0558.zip |
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.
Notes
Notes:
svn path=/head/; revision=69583
Diffstat (limited to 'sys/pci/if_sk.c')
-rw-r--r-- | sys/pci/if_sk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c index befe974b72f1..143c4e46d320 100644 --- a/sys/pci/if_sk.c +++ b/sys/pci/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); |