aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-stm32.c
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2018-03-30 22:54:44 +0300
committerMark Brown <broonie@kernel.org>2018-04-17 11:46:23 +0100
commit3dbb3eef91fdb246c7d366b960fe37b66af8ffa9 (patch)
treefe8c9c746fa91adbe47fca0d6d9b9d26af6c07bc /drivers/spi/spi-stm32.c
parentspi: sh-msiof: Fix bit field overflow writes to TSCR/RSCR (diff)
downloadlinux-dev-3dbb3eef91fdb246c7d366b960fe37b66af8ffa9.tar.xz
linux-dev-3dbb3eef91fdb246c7d366b960fe37b66af8ffa9.zip
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>
Diffstat (limited to 'drivers/spi/spi-stm32.c')
-rw-r--r--drivers/spi/spi-stm32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index ba9743fa2326..ad1e55d3d5d5 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -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);