summaryrefslogtreecommitdiff
path: root/sys/dev/softraid_crypto.c
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2009-06-09 23:17:36 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2009-06-09 23:17:36 +0000
commit17ce14df1013fdd4a80a2bdc367ae8a2aacfc60c (patch)
treea35408f33af36d881fb4f5b66abd53ddb351f09a /sys/dev/softraid_crypto.c
parent280e078e5b3f5817b6e9f42dd21aff1b5b54eec6 (diff)
fix potential null dereference.
Found by LLVM/Clang Static Analyzer. ok marco@
Diffstat (limited to 'sys/dev/softraid_crypto.c')
-rw-r--r--sys/dev/softraid_crypto.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c
index c5c407c67ff..71f4288ff10 100644
--- a/sys/dev/softraid_crypto.c
+++ b/sys/dev/softraid_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_crypto.c,v 1.36 2009/06/03 17:39:27 ckuethe Exp $ */
+/* $OpenBSD: softraid_crypto.c,v 1.37 2009/06/09 23:17:35 chl Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
@@ -185,8 +185,9 @@ sr_crypto_getcryptop(struct sr_workunit *wu, int encrypt)
unwind:
if (crp)
crypto_freereq(crp);
- if (wu->swu_xs->flags & SCSI_DATA_OUT)
- free(uio->uio_iov->iov_base, M_DEVBUF);
+ if (uio && uio->uio_iov)
+ if (wu->swu_xs->flags & SCSI_DATA_OUT)
+ free(uio->uio_iov->iov_base, M_DEVBUF);
s = splbio();
if (uio && uio->uio_iov)