Messages in this thread Patch in this message | | | Date | Mon, 06 Oct 2003 11:45:30 -0300 | From | Felipe W Damasio <> | Subject | [PATCH] Memory leak in mtd/chips/cfi_cmdset_0020 |
| |
Hi David,
Patch against 2.6.0-test6.
- Frees a previous allocated kmalloced variable before returning NULL;
Found by smatch.
Please consider applying,
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:37:50.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; } | |