diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2006-01-17 07:22:44 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2006-01-17 07:22:44 +0000 |
commit | 54df0743c7804ea61bf0bb57c056b14ae7312df8 (patch) | |
tree | eb04d66168b77ab1c5f4f1e93882f740afeb721c /sys/geom/nop | |
parent | e0078c64368a07b85d736f3249f5a134153ae86f (diff) | |
download | src-54df0743c7804ea61bf0bb57c056b14ae7312df8.tar.gz src-54df0743c7804ea61bf0bb57c056b14ae7312df8.zip |
Remove bio leak when EIO error is emulated.
Found by: Coverity Prevent(tm)
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=154458
Diffstat (limited to 'sys/geom/nop')
-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 40e951fc0349..6ab9fcc99bc4 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; |