diff options
author | Olivier Houchard <cognet@FreeBSD.org> | 2004-02-20 20:36:55 +0000 |
---|---|---|
committer | Olivier Houchard <cognet@FreeBSD.org> | 2004-02-20 20:36:55 +0000 |
commit | fdf2a3468ac2c5dc008b601576435c797f92abf8 (patch) | |
tree | 8064088244d9ed863a30adb9795c5c861adc876d /sys | |
parent | b8b31f33b199511ff1016d7ab6dd078844447e36 (diff) | |
download | src-fdf2a3468ac2c5dc008b601576435c797f92abf8.tar.gz src-fdf2a3468ac2c5dc008b601576435c797f92abf8.zip |
Do not test if pDCB is not NULL, we dereference it before anyway, and it
should not happen. Add a KASSERT instead.
Reported by: Ted Unangst <tedu@coverity.com>
Spotted out by: cperciva
Notes
Notes:
svn path=/head/; revision=126053
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/trm/trm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c index 42aa101349a7..00a507f27fdf 100644 --- a/sys/dev/trm/trm.c +++ b/sys/dev/trm/trm.c @@ -1334,11 +1334,10 @@ void *vpACB; if (scsi_intstatus & (INT_BUSSERVICE | INT_CMDDONE)) { pDCB = pACB->pActiveDCB; + KASSERT(pDCB != NULL, ("no active DCB")); pSRB = pDCB->pActiveSRB; - if (pDCB) { - if (pDCB->DCBFlag & ABORT_DEV_) + if (pDCB->DCBFlag & ABORT_DEV_) trm_EnableMsgOutAbort1(pACB, pSRB); - } phase = (u_int16_t) pSRB->ScsiPhase; /* phase: */ stateV = (void *) trm_SCSI_phase0[phase]; stateV(pACB, pSRB, &scsi_status); |