linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: spi-rockchip: Fix missing unwind goto in rockchip_sfc_probe()
@ 2023-04-19 11:50 Li Lanzhe
  2023-04-19 13:51 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Li Lanzhe @ 2023-04-19 11:50 UTC (permalink / raw)
  To: Mark Brown, Heiko Stuebner, Chris Morgan, Jon Lin
  Cc: Li Lanzhe, Dongliang Mu, linux-spi, linux-arm-kernel,
	linux-rockchip, linux-kernel

If devm_request_irq() fails, then we are directly return 'ret' without 
clk_disable_unprepare(sfc->clk) and clk_disable_unprepare(sfc->hclk).

Fix this by changing direct return to a goto 'err_irq'.

Fixes: 0b89fc0a367e ("spi: rockchip-sfc: add rockchip serial flash controller")
Signed-off-by: Li Lanzhe <u202212060@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
---
The issue is found by static analysis and remains untested.
---
 drivers/spi/spi-rockchip-sfc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
index bd87d3c92dd3..69347b6bf60c 100644
--- a/drivers/spi/spi-rockchip-sfc.c
+++ b/drivers/spi/spi-rockchip-sfc.c
@@ -632,7 +632,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
 	if (ret) {
 		dev_err(dev, "Failed to request irq\n");
 
-		return ret;
+		goto err_irq;
 	}
 
 	ret = rockchip_sfc_init(sfc);
-- 
2.39.2


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

* Re: [PATCH] spi: spi-rockchip: Fix missing unwind goto in rockchip_sfc_probe()
  2023-04-19 11:50 [PATCH] spi: spi-rockchip: Fix missing unwind goto in rockchip_sfc_probe() Li Lanzhe
@ 2023-04-19 13:51 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-04-19 13:51 UTC (permalink / raw)
  To: Heiko Stuebner, Chris Morgan, Jon Lin, Li Lanzhe
  Cc: Dongliang Mu, linux-spi, linux-arm-kernel, linux-rockchip, linux-kernel

On Wed, 19 Apr 2023 07:50:29 -0400, Li Lanzhe wrote:
> If devm_request_irq() fails, then we are directly return 'ret' without
> clk_disable_unprepare(sfc->clk) and clk_disable_unprepare(sfc->hclk).
> 
> Fix this by changing direct return to a goto 'err_irq'.
> 
> 

Applied to

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

Thanks!

[1/1] spi: spi-rockchip: Fix missing unwind goto in rockchip_sfc_probe()
      commit: 359f5b0d4e26b7a7bcc574d6148b31a17cefe47d

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


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

end of thread, other threads:[~2023-04-19 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19 11:50 [PATCH] spi: spi-rockchip: Fix missing unwind goto in rockchip_sfc_probe() Li Lanzhe
2023-04-19 13:51 ` 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).