summaryrefslogtreecommitdiffstats
path: root/sys/dev/trm
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2004-02-20 20:36:55 +0000
committercognet <cognet@FreeBSD.org>2004-02-20 20:36:55 +0000
commit2cb4b68cb5e0e39ff1cbec73cfdc4a92a3ef4af1 (patch)
tree8064088244d9ed863a30adb9795c5c861adc876d /sys/dev/trm
parentb9b55438a38eb58235ca7040d7ff56be4ed7d9d2 (diff)
downloadFreeBSD-src-2cb4b68cb5e0e39ff1cbec73cfdc4a92a3ef4af1.zip
FreeBSD-src-2cb4b68cb5e0e39ff1cbec73cfdc4a92a3ef4af1.tar.gz
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
Diffstat (limited to 'sys/dev/trm')
-rw-r--r--sys/dev/trm/trm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c
index 42aa101..00a507f 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);
OpenPOWER on IntegriCloud