From: Valentin Ilie <valentin.ilie@gmail.com>
To: mturquette@linaro.org, emilio@elopez.com.ar,
maxime.ripard@free-electrons.com,
gregory.clement@free-electrons.com, sboyd@codeaurora.org
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Valentin Ilie <valentin.ilie@gmail.com>
Subject: [PATCH] clk: sunxi: fix memory leaks
Date: Thu, 24 Oct 2013 15:25:13 +0300 [thread overview]
Message-ID: <1382617513-9259-1-git-send-email-valentin.ilie@gmail.com> (raw)
When the if condition is true, "fixed" and "gate" should be free'd before return.
Signed-off-by: Valentin Ilie <valentin.ilie@gmail.com>
---
drivers/clk/sunxi/clk-sunxi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 34ee69f..a970b55 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -48,8 +48,11 @@ static void __init sun4i_osc_clk_setup(struct device_node *node)
return;
}
- if (of_property_read_u32(node, "clock-frequency", &rate))
+ if (of_property_read_u32(node, "clock-frequency", &rate)) {
+ kfree(fixed);
+ kfree(gate);
return;
+ }
/* set up gate and fixed rate properties */
gate->reg = of_iomap(node, 0);
--
1.8.1.2
next reply other threads:[~2013-10-24 12:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-24 12:25 Valentin Ilie [this message]
2013-10-24 15:52 ` Maxime Ripard
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=1382617513-9259-1-git-send-email-valentin.ilie@gmail.com \
--to=valentin.ilie@gmail.com \
--cc=emilio@elopez.com.ar \
--cc=gregory.clement@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=mturquette@linaro.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
Powered by JetHome