summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2000-04-03 00:04:02 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2000-04-03 00:04:02 +0000
commitb38ba1375fa8a30740deec64e157e04e990ef3c2 (patch)
tree794c2a9f18a56d371f111a3c7f2d07f99fe25111 /sys
parent3c9037921dd11b5332d701c45741925c53e23e21 (diff)
Bring code into line with comment and ensure
that carr_freelist always has a carrier on it. This should fix a problem where carr_freelist has become NULL and then AdvISR() attempts to put a carrier back on the list without checking if carr_freelist is non-NULL. This and the previous two changes to adwlib.c and the change committed to adw.c at the same time were derived in whole or part from work done by/with dante@ from NetBSD.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/adwlib.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/ic/adwlib.c b/sys/dev/ic/adwlib.c
index 4db6ad7b194..73cbea33402 100644
--- a/sys/dev/ic/adwlib.c
+++ b/sys/dev/ic/adwlib.c
@@ -1882,7 +1882,7 @@ ADW_SCSI_REQ_Q *scsiq;
ADW_CCB *ccb;
long req_size;
u_int32_t req_paddr;
- ADW_CARRIER *new_carrp/*, *ccb_carr;
+ ADW_CARRIER *new_carrp, *new_freep/*, *ccb_carr;
int i*/;
@@ -1902,11 +1902,14 @@ ADW_SCSI_REQ_Q *scsiq;
* Allocate a carrier ensuring at least one carrier always
* remains on the freelist and initialize fields.
*/
- if ((new_carrp = sc->carr_freelist) == NULL) {
+ new_carrp = sc->carr_freelist;
+ new_freep = adw_carrier_phys_kv( sc,
+ ASC_GET_CARRP( new_carrp->next_vpa) );
+
+ if (new_freep == NULL) {
return ADW_BUSY;
}
- sc->carr_freelist = adw_carrier_phys_kv(sc,
- ASC_GET_CARRP(new_carrp->next_vpa));
+ sc->carr_freelist = new_freep;
sc->carr_pending_cnt++;
/*