未验证 提交 ded5fa4e 编写于 作者: A Alexey Khoroshilov 提交者: Mark Brown

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: NAlexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 0a090d65
...@@ -574,10 +574,15 @@ static int meson_spicc_probe(struct platform_device *pdev) ...@@ -574,10 +574,15 @@ static int meson_spicc_probe(struct platform_device *pdev)
master->max_speed_hz = rate >> 2; master->max_speed_hz = rate >> 2;
ret = devm_spi_register_master(&pdev->dev, master); 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; return 0;
dev_err(&pdev->dev, "spi master registration failed\n"); out_clk:
clk_disable_unprepare(spicc->core);
out_master: out_master:
spi_master_put(master); spi_master_put(master);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册