Commit 95730d5e authored by zpershuai's avatar zpershuai Committed by Mark Brown

spi: meson-spicc: fix a wrong goto jump for avoiding memory leak.

In meson_spifc_probe function, when enable the device pclk clock is
error, it should use clk_disable_unprepare to release the core clock.
Signed-off-by: default avatarzpershuai <zpershuai@gmail.com>
Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/1623562172-22056-1-git-send-email-zpershuai@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3acbacfc
...@@ -725,7 +725,7 @@ static int meson_spicc_probe(struct platform_device *pdev) ...@@ -725,7 +725,7 @@ static int meson_spicc_probe(struct platform_device *pdev)
ret = clk_prepare_enable(spicc->pclk); ret = clk_prepare_enable(spicc->pclk);
if (ret) { if (ret) {
dev_err(&pdev->dev, "pclk clock enable failed\n"); dev_err(&pdev->dev, "pclk clock enable failed\n");
goto out_master; goto out_core_clk;
} }
device_reset_optional(&pdev->dev); device_reset_optional(&pdev->dev);
...@@ -764,9 +764,11 @@ static int meson_spicc_probe(struct platform_device *pdev) ...@@ -764,9 +764,11 @@ static int meson_spicc_probe(struct platform_device *pdev)
return 0; return 0;
out_clk: out_clk:
clk_disable_unprepare(spicc->core);
clk_disable_unprepare(spicc->pclk); clk_disable_unprepare(spicc->pclk);
out_core_clk:
clk_disable_unprepare(spicc->core);
out_master: out_master:
spi_master_put(master); spi_master_put(master);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment