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

spi: stm32: Fix error handling in stm32_spi_probe()

clk_get_rate() is below clk_prepare_enable(), so
its error should lead to goto err_clk_disable, not to err_master_put.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: NAlexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: NAmelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 10b46408
...@@ -1129,7 +1129,7 @@ static int stm32_spi_probe(struct platform_device *pdev) ...@@ -1129,7 +1129,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
if (!spi->clk_rate) { if (!spi->clk_rate) {
dev_err(&pdev->dev, "clk rate = 0\n"); dev_err(&pdev->dev, "clk rate = 0\n");
ret = -EINVAL; ret = -EINVAL;
goto err_master_put; goto err_clk_disable;
} }
spi->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL); spi->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册