]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
mtd: rawnand: sunxi: Fix the probe error path
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 19 May 2020 13:00:26 +0000 (15:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Oct 2020 07:51:11 +0000 (09:51 +0200)
commit 3d84515ffd8fb657e10fa5b1215e9f095fa7efca upstream.

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-54-miquel.raynal@bootlin.com
[iwamatsu: adjust filename]
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/nand/sunxi_nand.c

index d6e31e8a7b668e8e1caf13867fe249c9bf1974f2..916e0ccd1e27ec89dbe9ee2034d06777a3baa052 100644 (file)
@@ -2125,7 +2125,7 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc,
        ret = mtd_device_register(mtd, NULL, 0);
        if (ret) {
                dev_err(dev, "failed to register mtd device: %d\n", ret);
-               nand_release(nand);
+               nand_cleanup(nand);
                return ret;
        }