mtd/drivers/mtd/chips sharp.c,1.8,1.9

joern at infradead.org joern at infradead.org
Thu Feb 13 16:12:32 EST 2003


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

Modified Files:
	sharp.c 
Log Message:
Fixed memory leak in sharp_probe().
All credit to Thayne Harbaugh for finding and fixing it.



Index: sharp.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/sharp.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- sharp.c	17 May 2002 08:59:19 -0000	1.8
+++ sharp.c	13 Feb 2003 21:12:30 -0000	1.9
@@ -116,8 +116,10 @@
 		return NULL;
 
 	sharp = kmalloc(sizeof(*sharp), GFP_KERNEL);
-	if(!sharp)
+	if(!sharp) {
+		kfree(mtd);
 		return NULL;
+	}
 
 	memset(mtd, 0, sizeof(*mtd));
 





More information about the linux-mtd-cvs mailing list