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

Unverified Commit ded5fa4e authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Mark Brown
Browse files

spi: meson-spicc: Fix error handling in meson_spicc_probe()



If devm_spi_register_master() fails in meson_spicc_probe(),
spicc->core is left undisabled. The patch fixes that.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0a090d65
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -574,10 +574,15 @@ static int meson_spicc_probe(struct platform_device *pdev)
		master->max_speed_hz = rate >> 2;

	ret = devm_spi_register_master(&pdev->dev, master);
	if (!ret)
	if (ret) {
		dev_err(&pdev->dev, "spi master registration failed\n");
		goto out_clk;
	}

	return 0;

	dev_err(&pdev->dev, "spi master registration failed\n");
out_clk:
	clk_disable_unprepare(spicc->core);

out_master:
	spi_master_put(master);