summaryrefslogtreecommitdiff
path: root/drivers/clk/at91/clk-h32mx.c
diff options
context:
space:
mode:
authorDavid Dueck <davidcdueck@googlemail.com>2015-06-26 16:30:22 +0300
committerStephen Boyd <sboyd@codeaurora.org>2015-07-02 19:51:50 +0300
commitc76a024e82bdb83a0f7d57e006f8e7f8ddf983e5 (patch)
tree3fbd028af32dd69f1fea0a5fe36dd3c3db26ade8 /drivers/clk/at91/clk-h32mx.c
parent15ab38273d21a45487116ad4c428593427954848 (diff)
downloadlinux-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-h32mx.c')
-rw-r--r--drivers/clk/at91/clk-h32mx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c
index 152dcb3f7b5f..61566bcefa53 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);
}