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
This commit is contained in:
mjacob 2001-04-09 05:41:41 +00:00
parent c86966a7ca
commit 49215b31ce

View File

@ -9136,6 +9136,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.
*/
@ -9371,20 +9379,11 @@ 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.