linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: vf610: fix error handling in vf610_nfc_probe()
@ 2017-12-22 21:43 Alexey Khoroshilov
  2017-12-22 21:57 ` Boris Brezillon
  0 siblings, 1 reply; 13+ messages in thread
From: Alexey Khoroshilov @ 2017-12-22 21:43 UTC (permalink / raw)
  To: Stefan Agner, Boris Brezillon
  Cc: Alexey Khoroshilov, Richard Weinberger, linux-mtd, linux-kernel,
	ldv-project

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>
---
 drivers/mtd/nand/vf610_nfc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 8037d4b48a05..a4c181af74b3 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -782,7 +782,10 @@ static int vf610_nfc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, mtd);
 
 	/* Register device in MTD */
-	return mtd_device_register(mtd, NULL, 0);
+	err = mtd_device_register(mtd, NULL, 0);
+	if (err)
+		goto error;
+	return 0;
 
 error:
 	of_node_put(nand_get_flash_node(chip));
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-02-12 21:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-22 21:43 [PATCH] mtd: nand: vf610: fix error handling in vf610_nfc_probe() Alexey Khoroshilov
2017-12-22 21:57 ` Boris Brezillon
2017-12-23 19:18   ` [PATCH v2] " Alexey Khoroshilov
2018-01-06  9:12     ` Boris Brezillon
2018-01-06  9:25     ` Boris Brezillon
2018-01-26 22:32       ` [PATCH v3] " Alexey Khoroshilov
2018-01-30 13:11         ` Boris Brezillon
2018-02-09 22:28           ` [PATCH v4 0/3] " Alexey Khoroshilov
2018-02-09 22:28             ` [PATCH v4 1/3] mtd: nand: vf610: remove the unnecessary of_node_put() Alexey Khoroshilov
2018-02-09 22:28             ` [PATCH v4 2/3] mtd: nand: vf610: improve readability of error label Alexey Khoroshilov
2018-02-09 22:28             ` [PATCH v4 3/3] mtd: nand: vf610: check mtd_device_register() return code Alexey Khoroshilov
2018-02-10  9:43               ` Stefan Agner
2018-02-12 21:31             ` [PATCH v4 0/3] mtd: nand: vf610: fix error handling in vf610_nfc_probe() Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).