public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm.c : Check memory allocations
@ 2002-12-27 21:55 Kevin Corry
  2002-12-27 22:00 ` Jeff Garzik
  2002-12-30 10:51 ` Joe Thornber
  0 siblings, 2 replies; 6+ messages in thread
From: Kevin Corry @ 2002-12-27 21:55 UTC (permalink / raw)
  To: Joe Thornber; +Cc: dm-devel, linux-kernel

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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-01-02  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-27 21:55 [PATCH] dm.c : Check memory allocations Kevin Corry
2002-12-27 22:00 ` Jeff Garzik
2002-12-27 22:16   ` Kevin Corry
2002-12-30 10:51 ` Joe Thornber
2002-12-31 16:22   ` Kevin Corry
2003-01-02  9:55     ` Joe Thornber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox