From: Boris BREZILLON Date: Sun, 13 Sep 2015 16:14:43 +0000 (+0200) Subject: mtd: nand: sunxi: fix sunxi_nand_chips_cleanup() X-Git-Tag: v4.2.4~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a03e4517ee5211298ecd102813ad12ea8b843129;p=thirdparty%2Fkernel%2Fstable.git mtd: nand: sunxi: fix sunxi_nand_chips_cleanup() 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 Signed-off-by: Boris Brezillon Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support") Tested-by: Priit Laes Signed-off-by: Brian Norris Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c index 6f93b2990d250..4f67bbe30fe5f 100644 --- a/drivers/mtd/nand/sunxi_nand.c +++ b/drivers/mtd/nand/sunxi_nand.c @@ -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); } }