summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_xl.c
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/pci/if_xl.c
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/pci/if_xl.c')
-rw-r--r--sys/pci/if_xl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index cfe67b6..eaa8901 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -1239,6 +1239,9 @@ static int xl_attach(dev)
sc = device_get_softc(dev);
unit = device_get_unit(dev);
+ mtx_init(&sc->xl_mtx, device_get_nameunit(dev), MTX_DEF);
+ XL_LOCK(sc);
+
sc->xl_flags = 0;
if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_556 ||
pci_get_device(dev) == TC_DEVICEID_HURRICANE_556B)
@@ -1382,9 +1385,6 @@ static int xl_attach(dev)
goto fail;
}
- mtx_init(&sc->xl_mtx, device_get_nameunit(dev), MTX_DEF);
- XL_LOCK(sc);
-
/* Reset the adapter. */
xl_reset(sc);
OpenPOWER on IntegriCloud