linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()
@ 2015-09-13 16:14 Boris Brezillon
  2015-09-13 16:26 ` [linux-sunxi] " Priit Laes
  2015-09-22  0:15 ` Brian Norris
  0 siblings, 2 replies; 4+ messages in thread
From: Boris Brezillon @ 2015-09-13 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

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")
---
 drivers/mtd/nand/sunxi_nand.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
index f9b5a4c..0467917 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -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);
 	}
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [linux-sunxi] [PATCH] mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()
  2015-09-13 16:14 [PATCH] mtd: nand: sunxi: fix sunxi_nand_chips_cleanup() Boris Brezillon
@ 2015-09-13 16:26 ` Priit Laes
  2015-09-22  0:15 ` Brian Norris
  1 sibling, 0 replies; 4+ messages in thread
From: Priit Laes @ 2015-09-13 16:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 2015-09-13 at 18:14 +0200, Boris Brezillon wrote:
> The sunxi_nand_chips_cleanup() function is missing a call to
> list_del()
> which generates a double free error.

Tested-by: Priit Laes <plaes@plaes.org>
> 
> 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")
> ---
>  drivers/mtd/nand/sunxi_nand.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/nand/sunxi_nand.c
> b/drivers/mtd/nand/sunxi_nand.c
> index f9b5a4c..0467917 100644
> --- a/drivers/mtd/nand/sunxi_nand.c
> +++ b/drivers/mtd/nand/sunxi_nand.c
> @@ -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);
>  	}
>  }
>  
> -- 
> 1.9.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()
  2015-09-13 16:14 [PATCH] mtd: nand: sunxi: fix sunxi_nand_chips_cleanup() Boris Brezillon
  2015-09-13 16:26 ` [linux-sunxi] " Priit Laes
@ 2015-09-22  0:15 ` Brian Norris
  2015-09-22  7:52   ` Boris Brezillon
  1 sibling, 1 reply; 4+ messages in thread
From: Brian Norris @ 2015-09-22  0:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Sep 13, 2015 at 06:14:43PM +0200, Boris Brezillon wrote:
> 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?

> 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")

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

Brian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] mtd: nand: sunxi: fix sunxi_nand_chips_cleanup()
  2015-09-22  0:15 ` Brian Norris
@ 2015-09-22  7:52   ` Boris Brezillon
  0 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2015-09-22  7:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Brian,

On Mon, 21 Sep 2015 17:15:28 -0700
Brian Norris <computersforpeace@gmail.com> wrote:

> On Sun, Sep 13, 2015 at 06:14:43PM +0200, Boris Brezillon wrote:
> > 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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-22  7:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-13 16:14 [PATCH] mtd: nand: sunxi: fix sunxi_nand_chips_cleanup() Boris Brezillon
2015-09-13 16:26 ` [linux-sunxi] " Priit Laes
2015-09-22  0:15 ` Brian Norris
2015-09-22  7:52   ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).