From: Gabor Juhos <j4g8y7@gmail.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Cheng Ming Lin <chengminglin@mxic.com.tw>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Gabor Juhos <j4g8y7@gmail.com>
Subject: [PATCH] mtd: spinand: cleanup ECC engine when spinand_randomizer_init() fails
Date: Thu, 19 Nov 2026 09:14:46 +0100 [thread overview]
Message-ID: <20261119-spinand-cleanup-ecc-engine-v1-1-60d007d2ddd8@gmail.com> (raw)
When the spinand_randomizer_init() fails, the code jumps to the
'err_cleanup_nanddev' label and the code leaves the ECC engine
initialized.
Change the respective goto statement to use the correct label which
ensures that the ECC engine gets cleaned up correctly.
Cc: stable@vger.kernel.org
Fixes: 54e1bc80af0c ("mtd: spinand: Add support for randomizer")
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
drivers/mtd/nand/spi/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 18bba02fbd31..f6741d121b70 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -1982,7 +1982,7 @@ static int spinand_init(struct spinand_device *spinand)
spinand_cont_read_init(spinand);
ret = spinand_randomizer_init(spinand);
if (ret)
- goto err_cleanup_nanddev;
+ goto err_cleanup_ecc_engine;
mtd->_read_oob = spinand_mtd_read;
mtd->_write_oob = spinand_mtd_write;
---
base-commit: 760d2efe91a84363d25c1051a10572242e75fe86
change-id: 20261118-spinand-cleanup-ecc-engine-da1af0ceae46
Best regards,
--
Gabor Juhos <j4g8y7@gmail.com>
reply other threads:[~2026-11-19 8:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261119-spinand-cleanup-ecc-engine-v1-1-60d007d2ddd8@gmail.com \
--to=j4g8y7@gmail.com \
--cc=chengminglin@mxic.com.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=stable@vger.kernel.org \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®