summaryrefslogtreecommitdiff
path: root/sys/dev/i2o/ioprbs.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-08-24 01:19:48 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-08-24 01:19:48 +0000
commitefa8667a804bfacc409a408004fb6e652d415407 (patch)
treec87fca66556bf676cde14015ed677b1c65aeff9c /sys/dev/i2o/ioprbs.c
parent0aaafe9e2db53a89bd3ba32b551710c7c206f52b (diff)
Test xs->bp before de-referencing it. Initialize it to NULL, not 0.
ok deraadt@
Diffstat (limited to 'sys/dev/i2o/ioprbs.c')
-rw-r--r--sys/dev/i2o/ioprbs.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/i2o/ioprbs.c b/sys/dev/i2o/ioprbs.c
index 118752c107d..1ded950a73a 100644
--- a/sys/dev/i2o/ioprbs.c
+++ b/sys/dev/i2o/ioprbs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ioprbs.c,v 1.7 2005/07/03 22:31:27 krw Exp $ */
+/* $OpenBSD: ioprbs.c,v 1.8 2005/08/24 01:19:47 krw Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
@@ -608,12 +608,14 @@ ioprbs_intr(struct device *dv, struct iop_msg *im, void *reply)
err = 1;
}
- if (err) {
- bp->b_flags |= B_ERROR;
- bp->b_error = EIO;
- bp->b_resid = bp->b_bcount;
- } else
- bp->b_resid = bp->b_bcount - letoh32(rb->transfercount);
+ if (bp) {
+ if (err) {
+ bp->b_flags |= B_ERROR;
+ bp->b_error = EIO;
+ bp->b_resid = bp->b_bcount;
+ } else
+ bp->b_resid = bp->b_bcount - letoh32(rb->transfercount);
+ }
iop_msg_unmap(iop, im);
iop_msg_free(iop, im);