[patch for 2.6.29? 4/4] mtd/maps: blackfin async flash maps: fix up memory leak

akpm at linux-foundation.org akpm at linux-foundation.org
Wed Feb 11 16:12:19 EST 2009


From: Mike Frysinger <vapier.adi at gmail.com>

Signed-off-by: Mike Frysinger <vapier.adi at gmail.com>
Signed-off-by: Bryan Wu <cooloney at kernel.org>
Cc: David Woodhouse <dwmw2 at infradead.org>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
---

 drivers/mtd/maps/bfin-async-flash.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN drivers/mtd/maps/bfin-async-flash.c~mtd-maps-blackfin-async-flash-maps-fix-up-memory-leak drivers/mtd/maps/bfin-async-flash.c
--- a/drivers/mtd/maps/bfin-async-flash.c~mtd-maps-blackfin-async-flash-maps-fix-up-memory-leak
+++ a/drivers/mtd/maps/bfin-async-flash.c
@@ -170,6 +170,7 @@ static int __devinit bfin_flash_probe(st
 	if (ret > 0) {
 		pr_devinit(KERN_NOTICE DRIVER_NAME ": Using commandline partition definition\n");
 		add_mtd_partitions(state->mtd, pdata->parts, ret);
+		kfree(pdata->parts);
 
 	} else if (pdata->nr_parts) {
 		pr_devinit(KERN_NOTICE DRIVER_NAME ": Using board partition definition\n");
_



More information about the linux-mtd mailing list