diff options
author | pjd <pjd@FreeBSD.org> | 2006-01-17 07:22:44 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-01-17 07:22:44 +0000 |
commit | a80ec2a9b9b641d402a5098d617df928a677dd4f (patch) | |
tree | eb04d66168b77ab1c5f4f1e93882f740afeb721c /sys/geom/nop/g_nop.c | |
parent | 0aa68bb51b19e543165aafd12583c1ce8365d222 (diff) | |
download | FreeBSD-src-a80ec2a9b9b641d402a5098d617df928a677dd4f.zip FreeBSD-src-a80ec2a9b9b641d402a5098d617df928a677dd4f.tar.gz |
Remove bio leak when EIO error is emulated.
Found by: Coverity Prevent(tm)
MFC after: 3 days
Diffstat (limited to 'sys/geom/nop/g_nop.c')
-rw-r--r-- | sys/geom/nop/g_nop.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/geom/nop/g_nop.c b/sys/geom/nop/g_nop.c index 40e951f..6ab9fcc 100644 --- a/sys/geom/nop/g_nop.c +++ b/sys/geom/nop/g_nop.c @@ -81,11 +81,6 @@ g_nop_start(struct bio *bp) gp = bp->bio_to->geom; sc = gp->softc; G_NOP_LOGREQ(bp, "Request received."); - cbp = g_clone_bio(bp); - if (cbp == NULL) { - g_io_deliver(bp, ENOMEM); - return; - } switch (bp->bio_cmd) { case BIO_READ: sc->sc_reads++; @@ -105,6 +100,11 @@ g_nop_start(struct bio *bp) return; } } + cbp = g_clone_bio(bp); + if (cbp == NULL) { + g_io_deliver(bp, ENOMEM); + return; + } cbp->bio_done = g_std_done; cbp->bio_offset = bp->bio_offset + sc->sc_offset; cbp->bio_data = bp->bio_data; |