summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2017-12-14 07:03:50 +0100
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-12-18 17:37:51 +0100
commitad99be47726ccb0bcbc4b0fac12c20cba78e4c0d (patch)
treec7702ac15f9a7c5b10152e2b3763b54326417f80
parent8b5c51a45c39c6d4f05c6f87d05f54b6c28f7c36 (diff)
mtd: onenand: samsung: return an error if 'mtd_device_parse_register()' fails
If 'mtd_device_parse_register()' fails, we still return 0 which mean success. Return the error code instead, as done in all the other error handling paths. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
-rw-r--r--drivers/mtd/onenand/samsung.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c
index bad59f5cc56d..c5416d6ad571 100644
--- a/drivers/mtd/onenand/samsung.c
+++ b/drivers/mtd/onenand/samsung.c
@@ -937,6 +937,11 @@ static int s3c_onenand_probe(struct platform_device *pdev)
err = mtd_device_parse_register(mtd, NULL, NULL,
pdata ? pdata->parts : NULL,
pdata ? pdata->nr_parts : 0);
+ if (err) {
+ dev_err(&pdev->dev, "failed to parse partitions and register the MTD device\n");
+ onenand_release(mtd);
+ return err;
+ }
platform_set_drvdata(pdev, mtd);