aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sym/sym_hipd.c
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>2001-04-09 05:41:41 +0000
committerMatt Jacob <mjacob@FreeBSD.org>2001-04-09 05:41:41 +0000
commit660fd204794016a0771c176a64166606d457facc (patch)
tree6ec3e2561a3f2857321756345cbca0c844420461 /sys/dev/sym/sym_hipd.c
parent3bcda1f14175cfc76c95ad8a1a94e614eb191092 (diff)
downloadsrc-660fd204794016a0771c176a64166606d457facc.tar.gz
src-660fd204794016a0771c176a64166606d457facc.zip
Correctly initialize free_ccbq so that if we fail to attach (as is
possible for some systems where the device is there, but the BIOS hasn't allocated memory resources for it), we don't panic. Submitted by: Gerard Roudier
Notes
Notes: svn path=/head/; revision=75329
Diffstat (limited to 'sys/dev/sym/sym_hipd.c')
-rw-r--r--sys/dev/sym/sym_hipd.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c
index eebd097d140f..60957dee83ca 100644
--- a/sys/dev/sym/sym_hipd.c
+++ b/sys/dev/sym/sym_hipd.c
@@ -9137,6 +9137,14 @@ sym_pci_attach2(pcici_t pci_tag, int unit)
snprintf(np->inst_name, sizeof(np->inst_name), "sym%d", np->unit);
/*
+ * Initialyze the CCB free and busy queues.
+ */
+ sym_que_init(&np->free_ccbq);
+ sym_que_init(&np->busy_ccbq);
+ sym_que_init(&np->comp_ccbq);
+ sym_que_init(&np->cam_ccbq);
+
+ /*
* Allocate a tag for the DMA of user data.
*/
#ifdef FreeBSD_Bus_Dma_Abstraction
@@ -9371,21 +9379,12 @@ sym_pci_attach2(pcici_t pci_tag, int unit)
goto attach_failed;
/*
- * Initialyze the CCB free and busy queues.
* Allocate some CCB. We need at least ONE.
*/
- sym_que_init(&np->free_ccbq);
- sym_que_init(&np->busy_ccbq);
- sym_que_init(&np->comp_ccbq);
if (!sym_alloc_ccb(np))
goto attach_failed;
/*
- * Initialyze the CAM CCB pending queue.
- */
- sym_que_init(&np->cam_ccbq);
-
- /*
* Calculate BUS addresses where we are going
* to load the SCRIPTS.
*/