Check return value of g_clone_bio().

This commit is contained in:
Poul-Henning Kamp 2003-02-06 22:00:47 +00:00
parent 133c1315d5
commit a42106534f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110477

View File

@ -194,6 +194,10 @@ g_disk_start(struct bio *bp)
case BIO_READ:
case BIO_WRITE:
bp2 = g_clone_bio(bp);
if (bp2 == NULL) {
error = ENOMEM;
break;
}
bp2->bio_done = g_disk_done;
bp2->bio_blkno = bp2->bio_offset >> DEV_BSHIFT;
bp2->bio_pblkno = bp2->bio_offset / dp->d_sectorsize;