Skip to content

Commit

Permalink
mtd: rawnand: sunxi: Fix the probe error path
Browse files Browse the repository at this point in the history
nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

Fixes: 1fef62c ("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
  • Loading branch information
Miquel Raynal committed May 31, 2020
1 parent 24acc3f commit 3d84515
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/nand/raw/sunxi_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,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;
}

Expand Down

0 comments on commit 3d84515

Please sign in to comment.