diff options
author | David Dueck <davidcdueck@googlemail.com> | 2015-06-26 15:30:22 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-07-02 09:51:50 -0700 |
commit | c76a024e82bdb83a0f7d57e006f8e7f8ddf983e5 (patch) | |
tree | 3fbd028af32dd69f1fea0a5fe36dd3c3db26ade8 /drivers/clk/at91/clk-utmi.c | |
parent | 15ab38273d21a45487116ad4c428593427954848 (diff) | |
download | linux-c76a024e82bdb83a0f7d57e006f8e7f8ddf983e5.tar.bz2 |
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-utmi.c')
-rw-r--r-- | drivers/clk/at91/clk-utmi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/clk/at91/clk-utmi.c b/drivers/clk/at91/clk-utmi.c index ae3263bc1476..30dd697b1668 100644 --- a/drivers/clk/at91/clk-utmi.c +++ b/drivers/clk/at91/clk-utmi.c @@ -118,12 +118,16 @@ at91_clk_register_utmi(struct at91_pmc *pmc, unsigned int irq, irq_set_status_flags(utmi->irq, IRQ_NOAUTOEN); ret = request_irq(utmi->irq, clk_utmi_irq_handler, IRQF_TRIGGER_HIGH, "clk-utmi", utmi); - if (ret) + if (ret) { + kfree(utmi); return ERR_PTR(ret); + } clk = clk_register(NULL, &utmi->hw); - if (IS_ERR(clk)) + if (IS_ERR(clk)) { + free_irq(utmi->irq, utmi); kfree(utmi); + } return clk; } |