From c3fce26a1fd15bf5024b15e70a30388013c683b6 Mon Sep 17 00:00:00 2001 From: pjd Date: Mon, 5 Jul 2004 13:24:22 +0000 Subject: [PATCH] g_clone_bio() can fail, be ready for this. Approved by: le --- sys/geom/vinum/geom_vinum.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/geom/vinum/geom_vinum.c b/sys/geom/vinum/geom_vinum.c index c4e96f4b768d..ebd92e217e06 100644 --- a/sys/geom/vinum/geom_vinum.c +++ b/sys/geom/vinum/geom_vinum.c @@ -93,8 +93,12 @@ gv_start(struct bio *bp) case BIO_WRITE: case BIO_DELETE: bp2 = g_clone_bio(bp); - bp2->bio_done = g_std_done; - g_io_request(bp2, LIST_FIRST(&gp->consumer)); + if (bp2 == NULL) + g_io_deliver(bp, ENOMEM); + else { + bp2->bio_done = g_std_done; + g_io_request(bp2, LIST_FIRST(&gp->consumer)); + } return; default: g_io_deliver(bp, EOPNOTSUPP);