From: David Dueck <davidcdueck@googlemail.com>
To: boris.brezillon@free-electrons.com
Cc: mturquette@linaro.org, nicolas.ferre@atmel.com,
sboyd@codeaurora.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/6] clk: at91: clk-h32mxclk: fix memory leak
Date: Fri, 26 Jun 2015 14:33:27 +0200 [thread overview]
Message-ID: <1435322012-5667-1-git-send-email-davidcdueck@googlemail.com> (raw)
Do not leak memory if clk_register fails.
Signed-off-by: David Dueck <davidcdueck@googlemail.com>
---
drivers/clk/at91/clk-h32mx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c
index 152dcb3..61566bc 100644
--- a/drivers/clk/at91/clk-h32mx.c
+++ b/drivers/clk/at91/clk-h32mx.c
@@ -116,8 +116,10 @@ void __init of_sama5d4_clk_h32mx_setup(struct device_node *np,
h32mxclk->pmc = pmc;
clk = clk_register(NULL, &h32mxclk->hw);
- if (!clk)
+ if (!clk) {
+ kfree(h32mxclk);
return;
+ }
of_clk_add_provider(np, of_clk_src_simple_get, clk);
}
--
2.4.4
next reply other threads:[~2015-06-26 12:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-26 12:33 David Dueck [this message]
2015-06-26 12:33 ` [PATCH 2/6] clk: at91: clk-main: fix memory leak David Dueck
2015-06-26 12:33 ` [PATCH 3/6] clk: at91: clk-master: fix error path David Dueck
2015-06-26 12:33 ` [PATCH 4/6] clk: at91: clk-pll: " David Dueck
2015-06-26 12:33 ` [PATCH 5/6] clk: at91: clk-system: " David Dueck
2015-06-26 12:33 ` [PATCH 6/6] clk: at91: clk-utmi: " David Dueck
2015-06-26 13:12 ` [PATCH 1/6] clk: at91: clk-h32mxclk: fix memory leak Boris Brezillon
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=1435322012-5667-1-git-send-email-davidcdueck@googlemail.com \
--to=davidcdueck@googlemail.com \
--cc=boris.brezillon@free-electrons.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=nicolas.ferre@atmel.com \
--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