Commit 6f533c46 authored by Miquel Raynal's avatar Miquel Raynal Committed by Boris Brezillon
Browse files

mtd: rawnand: hisi504: fix the probe function error path



An error after nand_scan_tail() should trigger a nand_cleanup() and not
a nand_release(). The latter doing an mtd_device_unregister() which is
not needed if mtd_device_register() failed.

Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
parent 9326dc75
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -808,7 +808,7 @@ static int hisi_nfc_probe(struct platform_device *pdev)
	ret = mtd_device_register(mtd, NULL, 0);
	if (ret) {
		dev_err(dev, "Err MTD partition=%d\n", ret);
		nand_release(mtd);
		nand_cleanup(chip);
		return ret;
	}