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

Commit 1b8c9098 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Boris Brezillon
Browse files

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: default avatarStefan Agner <stefan@agner.ch>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
parent 196644fd
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -767,8 +767,13 @@ 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 err_cleanup_nand;
	return 0;

err_cleanup_nand:
	nand_cleanup(chip);
err_disable_clk:
	clk_disable_unprepare(nfc->clk);
	return err;