diff options
author | David Dueck <davidcdueck@googlemail.com> | 2015-06-26 16:30:22 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-07-02 19:51:50 +0300 |
commit | c76a024e82bdb83a0f7d57e006f8e7f8ddf983e5 (patch) | |
tree | 3fbd028af32dd69f1fea0a5fe36dd3c3db26ade8 /drivers/clk/at91/clk-pll.c | |
parent | 15ab38273d21a45487116ad4c428593427954848 (diff) | |
download | linux-c76a024e82bdb83a0f7d57e006f8e7f8ddf983e5.tar.xz |
clk: at91: do not leak resources
Do not leak memory and free irqs in case of an error.
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: David Dueck <davidcdueck@googlemail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/at91/clk-pll.c')
-rw-r--r-- | drivers/clk/at91/clk-pll.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/clk/at91/clk-pll.c b/drivers/clk/at91/clk-pll.c index 6ec79dbc0840..23163be24b6f 100644 --- a/drivers/clk/at91/clk-pll.c +++ b/drivers/clk/at91/clk-pll.c @@ -338,12 +338,16 @@ at91_clk_register_pll(struct at91_pmc *pmc, unsigned int irq, const char *name, irq_set_status_flags(pll->irq, IRQ_NOAUTOEN); ret = request_irq(pll->irq, clk_pll_irq_handler, IRQF_TRIGGER_HIGH, id ? "clk-pllb" : "clk-plla", pll); - if (ret) + if (ret) { + kfree(pll); return ERR_PTR(ret); + } clk = clk_register(NULL, &pll->hw); - if (IS_ERR(clk)) + if (IS_ERR(clk)) { + free_irq(pll->irq, pll); kfree(pll); + } return clk; } |