summaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-01-23 20:30:52 -0800
committerOlof Johansson <olof@lixom.net>2013-01-23 20:30:52 -0800
commitf6be19c8bcca7185dcbda61f34f99d8b15bcd165 (patch)
tree28221937b24d1cbb372bb528f9f7368488c14470 /drivers/clk
parent51edce0ccee090ea762a3014510e7870d25c49df (diff)
parent09d75bc7d217bd8868899028a98b53423e6b3324 (diff)
Merge tag 'mvebu_fixes_for_v3.8-rc5' of git://git.infradead.org/users/jcooper/linux into fixes
From Jason Cooper: mvebu fixes for v3.8-rc5 - fix memory leak in mvebu/clk-cpu.c - use devm_ to correct/simplify error paths in mvsdio - add missing #interrupt-cells property in kirkwood * tag 'mvebu_fixes_for_v3.8-rc5' of git://git.infradead.org/users/jcooper/linux: ARM: kirkwood: fix missing #interrupt-cells property mmc: mvsdio: use devm_ API to simplify/correct error paths. clk: mvebu/clk-cpu.c: fix memory leakage
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/mvebu/clk-cpu.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/clk/mvebu/clk-cpu.c b/drivers/clk/mvebu/clk-cpu.c
index ff004578a11..9dd2551a0a4 100644
--- a/drivers/clk/mvebu/clk-cpu.c
+++ b/drivers/clk/mvebu/clk-cpu.c
@@ -124,7 +124,7 @@ void __init of_cpu_clk_setup(struct device_node *node)
clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL);
if (WARN_ON(!clks))
- return;
+ goto clks_out;
for_each_node_by_type(dn, "cpu") {
struct clk_init_data init;
@@ -134,11 +134,11 @@ void __init of_cpu_clk_setup(struct device_node *node)
int cpu, err;
if (WARN_ON(!clk_name))
- return;
+ goto bail_out;
err = of_property_read_u32(dn, "reg", &cpu);
if (WARN_ON(err))
- return;
+ goto bail_out;
sprintf(clk_name, "cpu%d", cpu);
parent_clk = of_clk_get(node, 0);
@@ -167,6 +167,9 @@ void __init of_cpu_clk_setup(struct device_node *node)
return;
bail_out:
kfree(clks);
+ while(ncpus--)
+ kfree(cpuclk[ncpus].clk_name);
+clks_out:
kfree(cpuclk);
}