[PATCH 6/6] Handle possible bio_alloc failure in bounce buffer

From: Nikanth Karthikesan
Date: Tue Apr 14 2009 - 07:12:12 EST


Handle possible bio_alloc failure in bounce buffer.

Signed-off-by: Nikanth Karthikesan <knikanth@xxxxxxx>

---

Index: linux-2.6/mm/bounce.c
===================================================================
--- linux-2.6.orig/mm/bounce.c
+++ linux-2.6/mm/bounce.c
@@ -202,6 +202,9 @@ static void __blk_queue_bounce(struct re
unsigned int cnt = (*bio_orig)->bi_vcnt;

bio = bio_alloc(GFP_NOIO, cnt);
+ if (unlikely(!bio))
+ panic("Unable to allocate bios\n");
+
memset(bio->bi_io_vec, 0, cnt * sizeof(struct bio_vec));
}



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/