Skip to contentSkip to conversation

mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()

PATCH New Boris Brezillon 3 participants 4 messages Sep 13, 2015 – Sep 22, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Cc <[email protected]> # 3.19+
Fixes 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support")
---
 drivers/mtd/nand/sunxi_nand.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/sunxi_nand.c +1 -0
index f9b5a4c..0467917 100644
@@ -1388,6 +1388,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);
 	}
 }
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()

Quoted 3 lines · Boris Brezillon

The sunxi_nand_chips_cleanup() function is missing a call to list_del()
which generates a double free error.

Quoted 27 lines
Cc <[email protected]> # 3.19+
Fixes 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller

support")

---
 drivers/mtd/nand/sunxi_nand.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/sunxi_nand.c +1 -0
index f9b5a4c..0467917 100644
@@ -1388,6 +1388,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);
 	}
 }
Signature · 2 lines
-- 
1.9.1
Applied
#2 lore raw

PATCH 1/1 mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()

In reply to Boris Brezillon
Quoted 2 lines · Boris Brezillon

The sunxi_nand_chips_cleanup() function is missing a call to list_del() which generates a double free error.

And if you could manage to get past that...an infinite loop, no?

Quoted 4 lines
Cc <[email protected]> # 3.19+
Fixes 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support")

Applied to linux-mtd.git, as this is a -stable fix.

Brian

#3 lore raw

PATCH 1/1 mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()

Hi Brian,

Quoted 5 lines · On Mon, 21 Sep 2015 17:15:28 -0700 Brian Norris <[email protected]>…
Quoted 2 lines · Boris Brezillon

The sunxi_nand_chips_cleanup() function is missing a call to list_del() which generates a double free error.

And if you could manage to get past that...an infinite loop, no?

Right, feel free to add it in the commit message.

Best Regards,

Boris

Signature · 3 lines
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com