g_clone_bio() can fail, be ready for this.

Approved by:	le
This commit is contained in:
Pawel Jakub Dawidek 2004-07-05 13:24:22 +00:00
parent 8160bf78a3
commit 1b39b2f671

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