diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c index f56a256dc3a9..7dd43f9b42d6 100644 --- a/sys/dev/ccd/ccd.c +++ b/sys/dev/ccd/ccd.c @@ -578,10 +578,7 @@ ccdstart(struct ccd_s *cs, struct bio *bp) err = ccdbuffer(cbp, cs, bp, bn, addr, bcount); if (err) { printf("ccdbuffer error %d\n", err); - /* We're screwed */ - bp->bio_resid -= bcount; - bp->bio_error = ENOMEM; - bp->bio_flags |= BIO_ERROR; + biofinish(bp, NULL, err); return; } rcount = cbp[0]->cb_buf.bio_bcount; diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index f56a256dc3a9..7dd43f9b42d6 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -578,10 +578,7 @@ ccdstart(struct ccd_s *cs, struct bio *bp) err = ccdbuffer(cbp, cs, bp, bn, addr, bcount); if (err) { printf("ccdbuffer error %d\n", err); - /* We're screwed */ - bp->bio_resid -= bcount; - bp->bio_error = ENOMEM; - bp->bio_flags |= BIO_ERROR; + biofinish(bp, NULL, err); return; } rcount = cbp[0]->cb_buf.bio_bcount;