* [PATCH -next] spi: bcm-qspi: Fix missing clk_disable_unprepare() on error in bcm_qspi_probe()
@ 2021-10-18 7:34 Yang Yingliang
2021-10-20 19:00 ` Kamal Dasu
2021-10-23 19:58 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2021-10-18 7:34 UTC (permalink / raw)
To: linux-kernel, linux-spi; +Cc: broonie, bcm-kernel-feedback-list, kdasu.kdev
Fix the missing clk_disable_unprepare() before return
from bcm_qspi_probe() in the error handling case.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/spi/spi-bcm-qspi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c
index 6cf7cff5edee..f3de3305d0f5 100644
--- a/drivers/spi/spi-bcm-qspi.c
+++ b/drivers/spi/spi-bcm-qspi.c
@@ -1602,7 +1602,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
&qspi->dev_ids[val]);
if (ret < 0) {
dev_err(&pdev->dev, "IRQ %s not found\n", name);
- goto qspi_probe_err;
+ goto qspi_unprepare_err;
}
qspi->dev_ids[val].dev = qspi;
@@ -1617,7 +1617,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
if (!num_ints) {
dev_err(&pdev->dev, "no IRQs registered, cannot init driver\n");
ret = -EINVAL;
- goto qspi_probe_err;
+ goto qspi_unprepare_err;
}
bcm_qspi_hw_init(qspi);
@@ -1641,6 +1641,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
qspi_reg_err:
bcm_qspi_hw_uninit(qspi);
+qspi_unprepare_err:
clk_disable_unprepare(qspi->clk);
qspi_probe_err:
kfree(qspi->dev_ids);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] spi: bcm-qspi: Fix missing clk_disable_unprepare() on error in bcm_qspi_probe()
2021-10-18 7:34 [PATCH -next] spi: bcm-qspi: Fix missing clk_disable_unprepare() on error in bcm_qspi_probe() Yang Yingliang
@ 2021-10-20 19:00 ` Kamal Dasu
2021-10-23 19:58 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Kamal Dasu @ 2021-10-20 19:00 UTC (permalink / raw)
To: Yang Yingliang
Cc: Linux Kernel Mailing List, linux-spi, Mark Brown,
bcm-kernel-feedback-list
On Mon, Oct 18, 2021 at 3:26 AM Yang Yingliang <yangyingliang@huawei.com> wrote:
>
> Fix the missing clk_disable_unprepare() before return
> from bcm_qspi_probe() in the error handling case.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Kamal Dasu <kdasu.kdev@gmail.com>
> ---
> drivers/spi/spi-bcm-qspi.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c
> index 6cf7cff5edee..f3de3305d0f5 100644
> --- a/drivers/spi/spi-bcm-qspi.c
> +++ b/drivers/spi/spi-bcm-qspi.c
> @@ -1602,7 +1602,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
> &qspi->dev_ids[val]);
> if (ret < 0) {
> dev_err(&pdev->dev, "IRQ %s not found\n", name);
> - goto qspi_probe_err;
> + goto qspi_unprepare_err;
> }
>
> qspi->dev_ids[val].dev = qspi;
> @@ -1617,7 +1617,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
> if (!num_ints) {
> dev_err(&pdev->dev, "no IRQs registered, cannot init driver\n");
> ret = -EINVAL;
> - goto qspi_probe_err;
> + goto qspi_unprepare_err;
> }
>
> bcm_qspi_hw_init(qspi);
> @@ -1641,6 +1641,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
>
> qspi_reg_err:
> bcm_qspi_hw_uninit(qspi);
> +qspi_unprepare_err:
> clk_disable_unprepare(qspi->clk);
> qspi_probe_err:
> kfree(qspi->dev_ids);
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] spi: bcm-qspi: Fix missing clk_disable_unprepare() on error in bcm_qspi_probe()
2021-10-18 7:34 [PATCH -next] spi: bcm-qspi: Fix missing clk_disable_unprepare() on error in bcm_qspi_probe() Yang Yingliang
2021-10-20 19:00 ` Kamal Dasu
@ 2021-10-23 19:58 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-10-23 19:58 UTC (permalink / raw)
To: linux-kernel, linux-spi, Yang Yingliang
Cc: Mark Brown, bcm-kernel-feedback-list, kdasu.kdev
On Mon, 18 Oct 2021 15:34:13 +0800, Yang Yingliang wrote:
> Fix the missing clk_disable_unprepare() before return
> from bcm_qspi_probe() in the error handling case.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: bcm-qspi: Fix missing clk_disable_unprepare() on error in bcm_qspi_probe()
commit: 0204bdeb3df79a5c78d9e76119a7f04e3dcb1258
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] 3+ messages in thread
end of thread, other threads:[~2021-10-23 19:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 7:34 [PATCH -next] spi: bcm-qspi: Fix missing clk_disable_unprepare() on error in bcm_qspi_probe() Yang Yingliang
2021-10-20 19:00 ` Kamal Dasu
2021-10-23 19:58 ` 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).