diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2018-02-09 17:28:36 -0500 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-02-12 17:36:05 -0500 |
commit | 1b8c90985f59ccd8a1adb723b58b42628b36e668 (patch) | |
tree | 6016752703403f6ebef2f9eda58af162ccf84eea | |
parent | 196644fd09ab7bf47040c0bdd1b48fc3c2bc08a6 (diff) |
mtd: nand: vf610: check mtd_device_register() return code
vf610_nfc_probe() misses error handling of mtd_device_register().
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
-rw-r--r-- | drivers/mtd/nand/vf610_nfc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c index 1939503b0960..5d7a1f8f580f 100644 --- a/drivers/mtd/nand/vf610_nfc.c +++ b/drivers/mtd/nand/vf610_nfc.c | |||
@@ -767,8 +767,13 @@ static int vf610_nfc_probe(struct platform_device *pdev) | |||
767 | platform_set_drvdata(pdev, mtd); | 767 | platform_set_drvdata(pdev, mtd); |
768 | 768 | ||
769 | /* Register device in MTD */ | 769 | /* Register device in MTD */ |
770 | return mtd_device_register(mtd, NULL, 0); | 770 | err = mtd_device_register(mtd, NULL, 0); |
771 | if (err) | ||
772 | goto err_cleanup_nand; | ||
773 | return 0; | ||
771 | 774 | ||
775 | err_cleanup_nand: | ||
776 | nand_cleanup(chip); | ||
772 | err_disable_clk: | 777 | err_disable_clk: |
773 | clk_disable_unprepare(nfc->clk); | 778 | clk_disable_unprepare(nfc->clk); |
774 | return err; | 779 | return err; |