mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Sep 21 17:59:01 PDT 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=8e375ccda31ccc73b087134e263c48d2114534f4
Commit:     8e375ccda31ccc73b087134e263c48d2114534f4
Parent:     03a0e8a7c5ea29b5c4e72dfd64900b47a8fb6f2d
Author:     Boris BREZILLON <boris.brezillon at free-electrons.com>
AuthorDate: Sun Sep 13 18:14:43 2015 +0200
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Sep 21 17:11:59 2015 -0700

    mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()
    
    The sunxi_nand_chips_cleanup() function is missing a call to list_del()
    which generates a double free error.
    
    Reported-by: Priit Laes <plaes at plaes.org>
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
    Cc: <stable at vger.kernel.org> # 3.19+
    Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support")
    Tested-by: Priit Laes <plaes at plaes.org>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/sunxi_nand.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
index 279cafd..e7d333c 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -1381,6 +1381,7 @@ static void sunxi_nand_chips_cleanup(struct sunxi_nfc *nfc)
 					node);
 		nand_release(&chip->mtd);
 		sunxi_nand_ecc_cleanup(&chip->nand.ecc);
+		list_del(&chip->node);
 	}
 }
 



More information about the linux-mtd-cvs mailing list