lkml.org 
[lkml]   [2003]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Memory leak in mtd/chips/cfi_cmdset_0020


David Woodhouse wrote:
> Applied; thanks. It'll be in the next update sent to Linus, when I get a
> few spare moments for merging and testing.

Great, thanks.

> Out of interest, why didn't smatch also find the same error 25 lines
> further down?

He did...I didn't ;)

If you want, updated patch is attached.

Cheers,

Felipe
--- linux-2.6.0-test6/drivers/mtd/chips/cfi_cmdset_0020.c.orig 2003-10-06 11:37:31.000000000 -0300
+++ linux-2.6.0-test6/drivers/mtd/chips/cfi_cmdset_0020.c 2003-10-06 11:52:40.000000000 -0300
@@ -208,6 +208,7 @@
if (!mtd->eraseregions) {
printk(KERN_ERR "Failed to allocate memory for MTD erase region info\n");
kfree(cfi->cmdset_priv);
+ kfree(mtd);
return NULL;
}

@@ -232,6 +233,7 @@
printk(KERN_WARNING "Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", offset, devsize);
kfree(mtd->eraseregions);
kfree(cfi->cmdset_priv);
+ kfree(mtd);
return NULL;
}
\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.197 / U:0.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site