Index: geom_io.c =================================================================== RCS file: /private/FreeBSD/src/sys/geom/geom_io.c,v retrieving revision 1.57 diff -u -p -r1.57 geom_io.c --- geom_io.c 11 Aug 2004 12:04:35 -0000 1.57 +++ geom_io.c 18 Aug 2004 21:25:31 -0000 @@ -167,6 +167,8 @@ g_io_getattr(const char *attr, struct g_ g_trace(G_T_BIO, "bio_getattr(%s)", attr); bp = g_new_bio(); + if (bp == NULL) + return (ENOMEM); bp->bio_cmd = BIO_GETATTR; bp->bio_done = NULL; bp->bio_attribute = attr; @@ -440,6 +442,11 @@ g_read_data(struct g_consumer *cp, off_t ("g_read_data(): invalid length %jd", (intmax_t)length)); bp = g_new_bio(); + if (bp == NULL) { + if (error != NULL) + *error = ENOMEM; + return (NULL); + } bp->bio_cmd = BIO_READ; bp->bio_done = NULL; bp->bio_offset = offset; @@ -468,6 +475,8 @@ g_write_data(struct g_consumer *cp, off_ ("g_write_data(): invalid length %jd", (intmax_t)length)); bp = g_new_bio(); + if (bp == NULL) + return (ENOMEM); bp->bio_cmd = BIO_WRITE; bp->bio_done = NULL; bp->bio_offset = offset;