[PATCH] mtdram.c

From: John Martin (suntzu@stanford.edu)
Date: Wed May 30 2001 - 20:54:31 EST


this seemed to be a straight forward null pointer bug. i just copied the
error handling code from about 5 lines below what i added in.
   -john martin

--- drivers/mtd/mtdram.c.orig Fri Feb 9 11:30:23 2001
+++ drivers/mtd/mtdram.c Sat May 26 20:52:56 2001
@@ -115,6 +115,11 @@
    mtd_info->size = MTDRAM_TOTAL_SIZE;
    mtd_info->erasesize = MTDRAM_ERASE_SIZE;
    mtd_info->priv = vmalloc(MTDRAM_TOTAL_SIZE);
+ if (!mtd_info->priv) {
+ kfree(mtd_info);
+ mtd_info = NULL;
+ return -ENOMEM;
+ }
    memset(mtd_info->priv, 0xff, MTDRAM_TOTAL_SIZE);

 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)

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



This archive was generated by hypermail 2b29 : Thu May 31 2001 - 21:00:49 EST