Browse Source

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@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>
Boris BREZILLON 10 years ago
parent
commit
8e375ccda3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/mtd/nand/sunxi_nand.c

+ 1 - 0
drivers/mtd/nand/sunxi_nand.c

@@ -1381,6 +1381,7 @@ static void sunxi_nand_chips_cleanup(struct sunxi_nfc *nfc)
 					node);
 					node);
 		nand_release(&chip->mtd);
 		nand_release(&chip->mtd);
 		sunxi_nand_ecc_cleanup(&chip->nand.ecc);
 		sunxi_nand_ecc_cleanup(&chip->nand.ecc);
+		list_del(&chip->node);
 	}
 	}
 }
 }