]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:49:28 +0000 (14:49 -0700)
commit 8e375ccda31ccc73b087134e263c48d2114534f4 upstream.

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>
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/nand/sunxi_nand.c

index 6f93b2990d250e76007ee355aed8054752aa33f9..4f67bbe30fe5f45db5b4c690885356cda4f77fc9 100644 (file)
@@ -1312,6 +1312,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);
        }
 }