Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-15 10:23:48 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-15 10:23:52 +0100
commit426e94448da9fc59167f267770d56edac3e94846 (patch)
treeac395729780372280ef6f003cf2a9717b7dd4d03
parentab98d1bdd65ad4d69c9e4715464103eab307a051 (diff)
mtd: spinand: Fix the error/cleanup path in spinand_init()
-rw-r--r--patches.kernel.org/4.20.9-003-mtd-spinand-Fix-the-error-cleanup-path-in-spin.patch44
-rw-r--r--series.conf1
2 files changed, 45 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.9-003-mtd-spinand-Fix-the-error-cleanup-path-in-spin.patch b/patches.kernel.org/4.20.9-003-mtd-spinand-Fix-the-error-cleanup-path-in-spin.patch
new file mode 100644
index 0000000000..1c6abbab25
--- /dev/null
+++ b/patches.kernel.org/4.20.9-003-mtd-spinand-Fix-the-error-cleanup-path-in-spin.patch
@@ -0,0 +1,44 @@
+From: Boris Brezillon <bbrezillon@kernel.org>
+Date: Thu, 24 Jan 2019 15:46:54 +0100
+Subject: [PATCH] mtd: spinand: Fix the error/cleanup path in spinand_init()
+References: bnc#1012628
+Patch-mainline: 4.20.9
+Git-commit: c3c7dbf4887ab3ed9d611cd1f6e16937f8700743
+
+commit c3c7dbf4887ab3ed9d611cd1f6e16937f8700743 upstream.
+
+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>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ 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 a78621c7b11d..8c7bf91ce4e1 100644
+--- a/drivers/mtd/nand/spi/core.c
++++ b/drivers/mtd/nand/spi/core.c
+@@ -1014,11 +1014,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.20.1
+
diff --git a/series.conf b/series.conf
index daa892493f..b1781671df 100644
--- a/series.conf
+++ b/series.conf
@@ -1085,6 +1085,7 @@
patches.kernel.org/4.20.8-346-Linux-4.20.8.patch
patches.kernel.org/4.20.9-001-mtd-Make-sure-mtd-erasesize-is-valid-even-if-t.patch
patches.kernel.org/4.20.9-002-mtd-spinand-Handle-the-case-where-PROGRAM-LOAD.patch
+ patches.kernel.org/4.20.9-003-mtd-spinand-Fix-the-error-cleanup-path-in-spin.patch
########################################################
# Build fixes that apply to the vanilla kernel too.