LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] spi: stm32: Fix error handling in stm32_spi_probe()
@ 2018-03-30 19:54 Alexey Khoroshilov
  2018-04-03  7:24 ` Amelie DELAUNAY
  2018-04-16 17:16 ` Applied "spi: stm32: Fix error handling in stm32_spi_probe()" to the spi tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Khoroshilov @ 2018-03-30 19:54 UTC (permalink / raw)
  To: Mark Brown, Amelie Delaunay, Maxime Coquelin, Alexandre Torgue
  Cc: Alexey Khoroshilov, linux-spi, linux-arm-kernel, linux-kernel,
	ldv-project

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>
---
 drivers/spi/spi-stm32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] spi: stm32: Fix error handling in stm32_spi_probe()
  2018-03-30 19:54 [PATCH] spi: stm32: Fix error handling in stm32_spi_probe() Alexey Khoroshilov
@ 2018-04-03  7:24 ` Amelie DELAUNAY
  2018-04-16 17:16 ` Applied "spi: stm32: Fix error handling in stm32_spi_probe()" to the spi tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Amelie DELAUNAY @ 2018-04-03  7:24 UTC (permalink / raw)
  To: Alexey Khoroshilov, Mark Brown, Maxime Coquelin, Alexandre TORGUE
  Cc: linux-spi, linux-arm-kernel, linux-kernel, ldv-project

Hi,

> -----Original Message-----
> From: Alexey Khoroshilov [mailto:khoroshilov@ispras.ru]
> Sent: vendredi 30 mars 2018 21:55
> To: Mark Brown <broonie@kernel.org>; Amelie DELAUNAY
> <amelie.delaunay@st.com>; Maxime Coquelin
> <mcoquelin.stm32@gmail.com>; Alexandre TORGUE
> <alexandre.torgue@st.com>
> Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>; linux-spi@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; ldv-
> project@linuxtesting.org
> Subject: [PATCH] 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>
> ---
>  drivers/spi/spi-stm32.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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);
> --
> 2.7.4

Thanks for the patch!

Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>

Regards,
Amelie

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "spi: stm32: Fix error handling in stm32_spi_probe()" to the spi tree
  2018-03-30 19:54 [PATCH] spi: stm32: Fix error handling in stm32_spi_probe() Alexey Khoroshilov
  2018-04-03  7:24 ` Amelie DELAUNAY
@ 2018-04-16 17:16 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2018-04-16 17:16 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: Mark Brown, Mark Brown, Amelie Delaunay, Maxime Coquelin,
	Alexandre Torgue, linux-spi, linux-arm-kernel, linux-kernel,
	ldv-project, linux-spi

The patch

   spi: stm32: Fix error handling in stm32_spi_probe()

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 05799ddf74f642911d27514227b89392ba02b26f Mon Sep 17 00:00:00 2001
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Fri, 30 Mar 2018 22:54:44 +0300
Subject: [PATCH] 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>
---
 drivers/spi/spi-stm32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.17.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-16 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-30 19:54 [PATCH] spi: stm32: Fix error handling in stm32_spi_probe() Alexey Khoroshilov
2018-04-03  7:24 ` Amelie DELAUNAY
2018-04-16 17:16 ` Applied "spi: stm32: Fix error handling in stm32_spi_probe()" to the spi tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).