Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: mvebu: add missing iounmap

Add missing iounmap to setup error path.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>

authored by

Jisheng Zhang and committed by
Mike Turquette
f98d007d 89ac8d7a

+15 -7
+3 -1
drivers/clk/mvebu/clk-cpu.c
··· 119 119 120 120 cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL); 121 121 if (WARN_ON(!cpuclk)) 122 - return; 122 + goto cpuclk_out; 123 123 124 124 clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL); 125 125 if (WARN_ON(!clks)) ··· 170 170 kfree(cpuclk[ncpus].clk_name); 171 171 clks_out: 172 172 kfree(cpuclk); 173 + cpuclk_out: 174 + iounmap(clock_complex_base); 173 175 } 174 176 175 177 CLK_OF_DECLARE(armada_xp_cpu_clock, "marvell,armada-xp-cpu-clock",
+12 -6
drivers/clk/mvebu/common.c
··· 45 45 clk_data.clk_num = 2 + desc->num_ratios; 46 46 clk_data.clks = kzalloc(clk_data.clk_num * sizeof(struct clk *), 47 47 GFP_KERNEL); 48 - if (WARN_ON(!clk_data.clks)) 48 + if (WARN_ON(!clk_data.clks)) { 49 + iounmap(base); 49 50 return; 51 + } 50 52 51 53 /* Register TCLK */ 52 54 of_property_read_string_index(np, "clock-output-names", 0, ··· 136 134 137 135 ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); 138 136 if (WARN_ON(!ctrl)) 139 - return; 137 + goto ctrl_out; 140 138 141 139 spin_lock_init(&ctrl->lock); 142 140 ··· 147 145 ctrl->num_gates = n; 148 146 ctrl->gates = kzalloc(ctrl->num_gates * sizeof(struct clk *), 149 147 GFP_KERNEL); 150 - if (WARN_ON(!ctrl->gates)) { 151 - kfree(ctrl); 152 - return; 153 - } 148 + if (WARN_ON(!ctrl->gates)) 149 + goto gates_out; 154 150 155 151 for (n = 0; n < ctrl->num_gates; n++) { 156 152 const char *parent = ··· 160 160 } 161 161 162 162 of_clk_add_provider(np, clk_gating_get_src, ctrl); 163 + 164 + return; 165 + gates_out: 166 + kfree(ctrl); 167 + ctrl_out: 168 + iounmap(base); 163 169 }