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 2/6] clk: at91: clk-main: fix memory leak
Date: Fri, 26 Jun 2015 14:33:28 +0200 [thread overview]
Message-ID: <1435322012-5667-2-git-send-email-davidcdueck@googlemail.com> (raw)
In-Reply-To: <1435322012-5667-1-git-send-email-davidcdueck@googlemail.com>
Do not leak memory if request_irq fails.
Signed-off-by: David Dueck <davidcdueck@googlemail.com>
---
drivers/clk/at91/clk-main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c
index 59fa3cc..696719e 100644
--- a/drivers/clk/at91/clk-main.c
+++ b/drivers/clk/at91/clk-main.c
@@ -171,8 +171,10 @@ at91_clk_register_main_osc(struct at91_pmc *pmc,
irq_set_status_flags(osc->irq, IRQ_NOAUTOEN);
ret = request_irq(osc->irq, clk_main_osc_irq_handler,
IRQF_TRIGGER_HIGH, name, osc);
- if (ret)
+ if (ret) {
+ kfree(osc);
return ERR_PTR(ret);
+ }
if (bypass)
pmc_write(pmc, AT91_CKGR_MOR,
--
2.4.4
next prev parent 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 [PATCH 1/6] clk: at91: clk-h32mxclk: fix memory leak David Dueck
2015-06-26 12:33 ` David Dueck [this message]
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-2-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