Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92aa292d authored by Miquel Raynal's avatar Miquel Raynal
Browse files

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



nand_cleanup() should be called upon error after a successful
nand_scan_tail().

Rework the error path to follow this rule .

Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 962c35ef
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -192,7 +192,11 @@ int sm_register_device(struct mtd_info *mtd, int smartmedia)
	if (ret)
		return ret;

	return mtd_device_register(mtd, NULL, 0);
	ret = mtd_device_register(mtd, NULL, 0);
	if (ret)
		nand_cleanup(chip);

	return ret;
}
EXPORT_SYMBOL_GPL(sm_register_device);