g_clone_bio() can fail, be ready for this.

Approved by:	le
This commit is contained in:
pjd 2004-07-05 13:24:22 +00:00
parent 99daa57e07
commit c3fce26a1f

View File

@ -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);