summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2011-05-02 22:15:12 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2011-05-02 22:15:12 +0000
commit550d7bec7d6ef3410aa3be8d26b49c05ac7b8d96 (patch)
treebc8ef60269d6c2b909ca9b9ada6025c5720da56e /sys
parentc716f15e6fbebc84f7588d0472100951c4252c9a (diff)
Fix potential null dereference.
Found by LLVM/Clang Static Analyzer. ok dlg@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/i2o/ioprbs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/i2o/ioprbs.c b/sys/dev/i2o/ioprbs.c
index e8e9abab62f..a4cdd6b2b89 100644
--- a/sys/dev/i2o/ioprbs.c
+++ b/sys/dev/i2o/ioprbs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ioprbs.c,v 1.30 2011/04/27 18:54:19 matthew Exp $ */
+/* $OpenBSD: ioprbs.c,v 1.31 2011/05/02 22:15:11 chl Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
@@ -669,7 +669,8 @@ ioprbs_get_ccb(void *cookie)
mtx_leave(&sc->sc_ccb_mtx);
/* initialise the command */
- ccb->ic_flags = 0;
+ if (ccb)
+ ccb->ic_flags = 0;
return (ccb);
}