Skip to content

Commit 3dbb3ee

Browse files
khoroshilovbroonie
authored andcommitted
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: Alexey Khoroshilov <khoroshilov@ispras.ru> Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 10b4640 commit 3dbb3ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-stm32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
11291129
if (!spi->clk_rate) {
11301130
dev_err(&pdev->dev, "clk rate = 0\n");
11311131
ret = -EINVAL;
1132-
goto err_master_put;
1132+
goto err_clk_disable;
11331133
}
11341134

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

0 commit comments

Comments
 (0)