Skip to content

Commit

Permalink
spi: stm32: Fix error handling in stm32_spi_probe()
Browse files Browse the repository at this point in the history
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: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Alexey Khoroshilov authored and Mark Brown committed Apr 17, 2018
1 parent 10b4640 commit 3dbb3ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
if (!spi->clk_rate) {
dev_err(&pdev->dev, "clk rate = 0\n");
ret = -EINVAL;
goto err_master_put;
goto err_clk_disable;
}

spi->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
Expand Down

0 comments on commit 3dbb3ee

Please sign in to comment.