mtd/drivers/mtd inftlmount.c,1.16,1.17

David Woodhouse dwmw2 at infradead.org
Mon Aug 8 04:56:22 EDT 2005


Update of /home/cvs/mtd/drivers/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv11170

Modified Files:
	inftlmount.c 
Log Message:
[MTD] Missing check on kmalloc return in INFTL mount.

Signed-off-by: Youssef Hmamouche <hyoussef at gmail.com>
Signed-off-by: David Woodhouse <dwmw2 at infradead.org>


Index: inftlmount.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/inftlmount.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- inftlmount.c	22 Nov 2004 13:50:53 -0000	1.16
+++ inftlmount.c	8 Aug 2005 08:56:19 -0000	1.17
@@ -563,7 +563,7 @@
 	/* Search for INFTL MediaHeader and Spare INFTL Media Header */
 	if (find_boot_record(s) < 0) {
 		printk(KERN_WARNING "INFTL: could not find valid boot record?\n");
-		return -1;
+		return -ENXIO;
 	}
 
 	/* Init the logical to physical table */
@@ -574,6 +574,11 @@
 
 	/* Temporary buffer to store ANAC numbers. */
 	ANACtable = kmalloc(s->nb_blocks * sizeof(u8), GFP_KERNEL);
+	if (!ANACtable) {
+		printk(KERN_ERR "INFTL: Out of memory.\n");
+		return -ENOMEM;
+	}
+		
 	memset(ANACtable, 0, s->nb_blocks);
 
 	/*





More information about the linux-mtd-cvs mailing list