[PATCH 2/2] mtd/ftl: fix the double free of the buffers allocated in build_maps()

Kevin Hao haokexin at gmail.com
Mon Jun 16 00:52:37 PDT 2014


In function build_maps(), it will free all the buffers it has allocated
before return with error. So the invoking of ftl_freepart() will causes
the buffers to be freed twice and then weird things would happen.

Signed-off-by: Kevin Hao <haokexin at gmail.com>
---
 drivers/mtd/ftl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index 71f2782f03fc..dabf08450d0b 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -1072,7 +1072,6 @@ static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
 			return;
 	}
 
-	ftl_freepart(partition);
 	kfree(partition);
 }
 
-- 
1.9.3




More information about the linux-mtd mailing list