stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: spinand: Fix the error/cleanup path in spinand_init()
@ 2019-01-24 14:46 Boris Brezillon
  2019-01-25 11:07 ` Miquel Raynal
  2019-01-31 11:32 ` Boris Brezillon
  0 siblings, 2 replies; 3+ messages in thread
From: Boris Brezillon @ 2019-01-24 14:46 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, Miquel Raynal, linux-mtd
  Cc: David Woodhouse, Brian Norris, Marek Vasut, stable

The manufacturer specific initialization has already been done when
block unlocking takes place, and if anything goes wrong during this
procedure we should call spinand_manufacturer_cleanup().

Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
---
 drivers/mtd/nand/spi/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 8bf37da19663..fa87ae28cdfe 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -1016,11 +1016,11 @@ static int spinand_init(struct spinand_device *spinand)
 	for (i = 0; i < nand->memorg.ntargets; i++) {
 		ret = spinand_select_target(spinand, i);
 		if (ret)
-			goto err_free_bufs;
+			goto err_manuf_cleanup;
 
 		ret = spinand_lock_block(spinand, BL_ALL_UNLOCKED);
 		if (ret)
-			goto err_free_bufs;
+			goto err_manuf_cleanup;
 	}
 
 	ret = nanddev_init(nand, &spinand_ops, THIS_MODULE);
-- 
2.17.1


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

* Re: [PATCH] mtd: spinand: Fix the error/cleanup path in spinand_init()
  2019-01-24 14:46 [PATCH] mtd: spinand: Fix the error/cleanup path in spinand_init() Boris Brezillon
@ 2019-01-25 11:07 ` Miquel Raynal
  2019-01-31 11:32 ` Boris Brezillon
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2019-01-25 11:07 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Richard Weinberger, linux-mtd, David Woodhouse, Brian Norris,
	Marek Vasut, stable

Hi Boris,

Boris Brezillon <bbrezillon@kernel.org> wrote on Thu, 24 Jan 2019
15:46:54 +0100:

> The manufacturer specific initialization has already been done when
> block unlocking takes place, and if anything goes wrong during this
> procedure we should call spinand_manufacturer_cleanup().
> 
> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
> ---
>  drivers/mtd/nand/spi/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 8bf37da19663..fa87ae28cdfe 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -1016,11 +1016,11 @@ static int spinand_init(struct spinand_device *spinand)
>  	for (i = 0; i < nand->memorg.ntargets; i++) {
>  		ret = spinand_select_target(spinand, i);
>  		if (ret)
> -			goto err_free_bufs;
> +			goto err_manuf_cleanup;
>  
>  		ret = spinand_lock_block(spinand, BL_ALL_UNLOCKED);
>  		if (ret)
> -			goto err_free_bufs;
> +			goto err_manuf_cleanup;
>  	}
>  
>  	ret = nanddev_init(nand, &spinand_ops, THIS_MODULE);


Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>


Thanks,
Miquèl

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

* Re: mtd: spinand: Fix the error/cleanup path in spinand_init()
  2019-01-24 14:46 [PATCH] mtd: spinand: Fix the error/cleanup path in spinand_init() Boris Brezillon
  2019-01-25 11:07 ` Miquel Raynal
@ 2019-01-31 11:32 ` Boris Brezillon
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2019-01-31 11:32 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, Miquel Raynal, linux-mtd
  Cc: Marek Vasut, Brian Norris, David Woodhouse, stable

On Thu, 2019-01-24 at 14:46:54 UTC, Boris Brezillon wrote:
> The manufacturer specific initialization has already been done when
> block unlocking takes place, and if anything goes wrong during this
> procedure we should call spinand_manufacturer_cleanup().
> 
> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to http://git.infradead.org/linux-mtd.git mtd/fixes.

Boris

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

end of thread, other threads:[~2019-01-31 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-24 14:46 [PATCH] mtd: spinand: Fix the error/cleanup path in spinand_init() Boris Brezillon
2019-01-25 11:07 ` Miquel Raynal
2019-01-31 11:32 ` 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).