mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Sun, 13 Sep 2015 16:14:43 +0000 (18:14 +0200)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 22 Sep 2015 00:11:59 +0000 (17:11 -0700)
The sunxi_nand_chips_cleanup() function is missing a call to list_del()
which generates a double free error.

Reported-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: <stable@vger.kernel.org> # 3.19+
Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support")
Tested-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/sunxi_nand.c

index 279cafd9d7f75bd8f424b9c13fb1abe70ed3a3b2..e7d333c162befd274f891b8674b5ca8fd905315e 100644 (file)
@@ -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);
        }
 }