summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2011-04-19 21:59:52 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2011-04-19 21:59:52 +0000
commit6b79b3ddc76a29d52687eb03c3788e4894d8175f (patch)
tree04a23effe6ac833def94a0c32457564903156656 /sys/dev/ic
parent7bbb80b4591b779c3ffe4adbb4759fd95ce5b360 (diff)
Fix potential null dereference.
Found by LLVM/Clang Static Analyzer. ok marco@ krw@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/aic79xx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ic/aic79xx.c b/sys/dev/ic/aic79xx.c
index 3e4863496b8..2fc227c23b4 100644
--- a/sys/dev/ic/aic79xx.c
+++ b/sys/dev/ic/aic79xx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic79xx.c,v 1.47 2010/09/22 00:35:19 jsg Exp $ */
+/* $OpenBSD: aic79xx.c,v 1.48 2011/04/19 21:59:51 chl Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -2394,7 +2394,8 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd)
*/
if (printerror != 0
&& (lastphase == P_MESGIN || lastphase == P_MESGOUT)
- && ((ahd->msg_flags & MSG_FLAG_EXPECT_PPR_BUSFREE) != 0)) {
+ && ((ahd->msg_flags & MSG_FLAG_EXPECT_PPR_BUSFREE) != 0)
+ && (scb != NULL)) {
ahd_freeze_devq(ahd, scb);
aic_set_transaction_status(scb, CAM_REQUEUE_REQ);