linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: au1xmmc: Fix an error handling path in au1xmmc_probe()
@ 2022-08-25  7:33 Christophe JAILLET
  2022-08-26  9:16 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-08-25  7:33 UTC (permalink / raw)
  To: Manuel Lauss, Ulf Hansson, Ralf Baechle
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-mmc

If clk_prepare_enable() fails, there is no point in calling
clk_disable_unprepare() in the error handling path.

Move the out_clk label at the right place.

Fixes: b6507596dfd6 ("MIPS: Alchemy: au1xmmc: use clk framework")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/mmc/host/au1xmmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
index a9a0837153d8..c88b039dc9fb 100644
--- a/drivers/mmc/host/au1xmmc.c
+++ b/drivers/mmc/host/au1xmmc.c
@@ -1097,8 +1097,9 @@ static int au1xmmc_probe(struct platform_device *pdev)
 	if (host->platdata && host->platdata->cd_setup &&
 	    !(mmc->caps & MMC_CAP_NEEDS_POLL))
 		host->platdata->cd_setup(mmc, 0);
-out_clk:
+
 	clk_disable_unprepare(host->clk);
+out_clk:
 	clk_put(host->clk);
 out_irq:
 	free_irq(host->irq, host);
-- 
2.34.1


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

* Re: [PATCH] mmc: au1xmmc: Fix an error handling path in au1xmmc_probe()
  2022-08-25  7:33 [PATCH] mmc: au1xmmc: Fix an error handling path in au1xmmc_probe() Christophe JAILLET
@ 2022-08-26  9:16 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2022-08-26  9:16 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Manuel Lauss, Ralf Baechle, linux-kernel, kernel-janitors, linux-mmc

On Thu, 25 Aug 2022 at 09:34, Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> If clk_prepare_enable() fails, there is no point in calling
> clk_disable_unprepare() in the error handling path.
>
> Move the out_clk label at the right place.
>
> Fixes: b6507596dfd6 ("MIPS: Alchemy: au1xmmc: use clk framework")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/au1xmmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
> index a9a0837153d8..c88b039dc9fb 100644
> --- a/drivers/mmc/host/au1xmmc.c
> +++ b/drivers/mmc/host/au1xmmc.c
> @@ -1097,8 +1097,9 @@ static int au1xmmc_probe(struct platform_device *pdev)
>         if (host->platdata && host->platdata->cd_setup &&
>             !(mmc->caps & MMC_CAP_NEEDS_POLL))
>                 host->platdata->cd_setup(mmc, 0);
> -out_clk:
> +
>         clk_disable_unprepare(host->clk);
> +out_clk:
>         clk_put(host->clk);
>  out_irq:
>         free_irq(host->irq, host);
> --
> 2.34.1
>

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

end of thread, other threads:[~2022-08-26  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25  7:33 [PATCH] mmc: au1xmmc: Fix an error handling path in au1xmmc_probe() Christophe JAILLET
2022-08-26  9:16 ` Ulf Hansson

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).