[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAC=U0a2i5NXdWHYg5TevXZ24ujuLpx0-2631XViXHkBVhZAZzA@mail.gmail.com>
Date: Wed, 20 Oct 2021 15:00:00 -0400
From: Kamal Dasu <kdasu.kdev@...il.com>
To: Yang Yingliang <yangyingliang@...wei.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-spi <linux-spi@...r.kernel.org>,
Mark Brown <broonie@...nel.org>,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@...adcom.com>
Subject: Re: [PATCH -next] spi: bcm-qspi: Fix missing clk_disable_unprepare()
on error in bcm_qspi_probe()
On Mon, Oct 18, 2021 at 3:26 AM Yang Yingliang <yangyingliang@...wei.com> wrote:
>
> Fix the missing clk_disable_unprepare() before return
> from bcm_qspi_probe() in the error handling case.
>
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
Reviewed-by: Kamal Dasu <kdasu.kdev@...il.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
>
Powered by blists - more mailing lists