lkml.org 
[lkml]   [2001]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] mtdram.c
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/

\
 
 \ /
  Last update: 2005-03-22 12:54    [W:0.032 / U:2.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site