Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1343455 > unrolled thread

[PATCH] clk: shmobile: Free 'clock' on error path

Started byStephen Boyd <sboyd@codeaurora.org>
First post2016-02-25 21:30 +0100
Last post2016-02-25 21:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] clk: shmobile: Free 'clock' on error path Stephen Boyd <sboyd@codeaurora.org> - 2016-02-25 21:30 +0100
    Re: [PATCH] clk: shmobile: Free 'clock' on error path Geert Uytterhoeven <geert@linux-m68k.org> - 2016-02-25 21:40 +0100

#1343455 — [PATCH] clk: shmobile: Free 'clock' on error path

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-02-25 21:30 +0100
Subject[PATCH] clk: shmobile: Free 'clock' on error path
Message-ID<r6aHV-HU-19@gated-at.bofh.it>
We forgot to free this clock when we return early in this code.

Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/clk/shmobile/renesas-cpg-mssr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/shmobile/renesas-cpg-mssr.c b/drivers/clk/shmobile/renesas-cpg-mssr.c
index 925b6007e531..58e24b326a48 100644
--- a/drivers/clk/shmobile/renesas-cpg-mssr.c
+++ b/drivers/clk/shmobile/renesas-cpg-mssr.c
@@ -348,6 +348,7 @@ static void __init cpg_mssr_register_mod_clk(const struct mssr_mod_clk *mod,
 #else
 			dev_dbg(dev, "Ignoring MSTP %s to prevent disabling\n",
 				mod->name);
+			kfree(clock);
 			return;
 #endif
 		}
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [next] | [standalone]


#1343461

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-02-25 21:40 +0100
Message-ID<r6aRz-Ng-1@gated-at.bofh.it>
In reply to#1343455
Hi Stephen,

On Thu, Feb 25, 2016 at 9:26 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> We forgot to free this clock when we return early in this code.
>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

> ---
>  drivers/clk/shmobile/renesas-cpg-mssr.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clk/shmobile/renesas-cpg-mssr.c b/drivers/clk/shmobile/renesas-cpg-mssr.c
> index 925b6007e531..58e24b326a48 100644
> --- a/drivers/clk/shmobile/renesas-cpg-mssr.c
> +++ b/drivers/clk/shmobile/renesas-cpg-mssr.c
> @@ -348,6 +348,7 @@ static void __init cpg_mssr_register_mod_clk(const struct mssr_mod_clk *mod,
>  #else
>                         dev_dbg(dev, "Ignoring MSTP %s to prevent disabling\n",
>                                 mod->name);
> +                       kfree(clock);
>                         return;
>  #endif

I had hoped for the whole "#else /* !CLK_ENABLE_HAND_OFF */" branch
to be removed before anyone would start to fix silly issues like this ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web