lkml.org 
[lkml]   [2001]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ftl.c - Null ptr fixes 2.4.4
Date
Hi,
Using the Stanford checker, we searched for null-pointer bugs in the linux
kernel code. This patch fixes an unchecked pointer in an MTD driver (ftl.c).

Praveen Srinivasan and Frederick Akalin

--- ../linux/./drivers/mtd/ftl.c Fri Feb 9 11:30:23 2001
+++ ./drivers/mtd/ftl.c Mon May 7 22:01:29 2001
@@ -375,6 +375,11 @@
/* Set up virtual page map */
blocks = le32_to_cpu(header.FormattedSize) >> header.BlockSize;
part->VirtualBlockMap = vmalloc(blocks * sizeof(u_int32_t));
+
+ if(part->VirtualBlockMap==NULL) {
+ return -1;
+ }
+
memset(part->VirtualBlockMap, 0xff, blocks * sizeof(u_int32_t));
part->BlocksPerUnit = (1 << header.EraseUnitSize) >> header.BlockSize;
-
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:53    [W:0.029 / U:3.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site