diff options
-rw-r--r-- | sys/dev/i2o/ioprbs.c | 16 | ||||
-rw-r--r-- | sys/dev/ic/aac.c | 7 | ||||
-rw-r--r-- | sys/scsi/sd.c | 4 |
3 files changed, 17 insertions, 10 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); diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index 33b142ac256..cb9da97fdad 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac.c,v 1.22 2005/08/21 02:31:13 krw Exp $ */ +/* $OpenBSD: aac.c,v 1.23 2005/08/24 01:19:47 krw Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -1080,6 +1080,9 @@ aac_bio_complete(struct aac_ccb *ccb) struct aac_blockwrite_response *bwr; AAC_FSAStatus status; + if (bp == NULL) + goto done; + /* fetch relevant status and then release the command */ if (bp->b_flags & B_READ) { brr = (struct aac_blockread_response *)&ccb->ac_fib->data[0]; @@ -1101,6 +1104,8 @@ aac_bio_complete(struct aac_ccb *ccb) printf("%s: I/O error %d (%s)\n", sc->sc_dev.dv_xname, status, AAC_COMMAND_STATUS(status)); } + +done: scsi_done(xs); } diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 57513481242..985a34efecc 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.88 2005/08/23 23:38:00 krw Exp $ */ +/* $OpenBSD: sd.c,v 1.89 2005/08/24 01:19:47 krw Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -1269,7 +1269,7 @@ sddump(dev, blkno, va, size) xs->cmdlen = sizeof(cmd); xs->resid = nwrt * sectorsize; xs->error = XS_NOERROR; - xs->bp = 0; + xs->bp = NULL; xs->data = va; xs->datalen = nwrt * sectorsize; |