mtd/drivers/mtd inftlmount.c,1.16,1.17
David Woodhouse
dwmw2 at infradead.org
Mon Aug 8 04:56:22 EDT 2005
- Previous message: mtd/fs/jffs2 fs.c,1.61,1.62 os-linux.h,1.59,1.60 wbuf.c,1.96,1.97
- Next message: mtd/Documentation/jffs3 dent_key.eps, NONE, 1.1 dent_key.pdf, NONE,
1.1 file_key.eps, NONE, 1.1 file_key.pdf, NONE, 1.1 sd_key.eps,
NONE, 1.1 sd_key.pdf, NONE, 1.1 JFFS3design.tex, 1.7, 1.8
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
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);
/*
- Previous message: mtd/fs/jffs2 fs.c,1.61,1.62 os-linux.h,1.59,1.60 wbuf.c,1.96,1.97
- Next message: mtd/Documentation/jffs3 dent_key.eps, NONE, 1.1 dent_key.pdf, NONE,
1.1 file_key.eps, NONE, 1.1 file_key.pdf, NONE, 1.1 sd_key.eps,
NONE, 1.1 sd_key.pdf, NONE, 1.1 JFFS3design.tex, 1.7, 1.8
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the linux-mtd-cvs
mailing list