From: Michael Turquette <mturquette@baylibre.com>
To: Brian Norris <computersforpeace@gmail.com>,
"Stephen Boyd" <sboyd@codeaurora.org>
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
"Brian Norris" <computersforpeace@gmail.com>,
"Jyri Sarha" <jsarha@ti.com>, "Sergej Sawazki" <ce3a@gmx.de>
Subject: Re: [PATCH] clk: gpio: fix memory leak in of_gpio_clk_setup()
Date: Thu, 31 Dec 2015 21:56:32 -0800 [thread overview]
Message-ID: <20160101055632.21738.88763@quark.deferred.io> (raw)
In-Reply-To: <1450290511-14442-1-git-send-email-computersforpeace@gmail.com>
Quoting Brian Norris (2015-12-16 10:28:31)
> Reported by Coverity.
>
> Fixes: f66541ba02d5 ("clk: gpio: Get parent clk names in of_gpio_clk_setup()")
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> Cc: Jyri Sarha <jsarha@ti.com>
> Cc: Sergej Sawazki <ce3a@gmx.de>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
Thanks for the fix. I already applied this one:
http://lkml.kernel.org/r/<1450852439-366-1-git-send-email-sudipm.mukherjee@gmail.com>
Regards,
Mike
> ---
> drivers/clk/clk-gpio.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
> index 335322dc403f..c1baa89cbf91 100644
> --- a/drivers/clk/clk-gpio.c
> +++ b/drivers/clk/clk-gpio.c
> @@ -294,8 +294,10 @@ static void __init of_gpio_clk_setup(struct device_node *node,
> num_parents = of_clk_get_parent_count(node);
>
> parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL);
> - if (!parent_names)
> + if (!parent_names) {
> + kfree(data);
> return;
> + }
>
> for (i = 0; i < num_parents; i++)
> parent_names[i] = of_clk_get_parent_name(node, i);
> --
> 2.6.0.rc2.230.g3dd15c0
>
prev parent reply other threads:[~2016-01-01 5:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 18:28 Brian Norris
2015-12-16 18:35 ` [PATCH] clk: gpio: handle error codes for of_clk_get_parent_count() Brian Norris
2016-01-01 5:57 ` Michael Turquette
2016-01-01 5:56 ` Michael Turquette [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160101055632.21738.88763@quark.deferred.io \
--to=mturquette@baylibre.com \
--cc=ce3a@gmx.de \
--cc=computersforpeace@gmail.com \
--cc=jsarha@ti.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®