[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[dm-devel] [PATCH] dm.c : Check memory allocations
- From: Kevin Corry <corry ecn purdue edu>
- To: joe fib011235813 fsnet co uk (Joe Thornber)
- Cc: dm-devel sistina com, linux-kernel vger kernel org
- Subject: [dm-devel] [PATCH] dm.c : Check memory allocations
- Date: Fri Dec 27 15:55:02 2002
Check memory allocations when cloning bio's.
--- linux-2.5.53a/drivers/md/dm.c Mon Dec 23 23:21:04 2002
+++ linux-2.5.53b/drivers/md/dm.c Fri Dec 27 14:50:29 2002
@@ -394,6 +393,10 @@
*/
clone = clone_bio(bio, ci->sector, ci->idx,
bio->bi_vcnt - ci->idx, ci->sector_count);
+ if (!clone) {
+ dec_pending(ci->io, -ENOMEM);
+ return;
+ }
__map_bio(ti, clone, ci->io);
ci->sector_count = 0;
@@ -417,6 +420,10 @@
}
clone = clone_bio(bio, ci->sector, ci->idx, i - ci->idx, len);
+ if (!clone) {
+ dec_pending(ci->io, -ENOMEM);
+ return;
+ }
__map_bio(ti, clone, ci->io);
ci->sector += len;
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]