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

clk: rockchip: disable alt_parent clk in err cases when registering cpuclk

Add clk_disable_unprepare to handle cpuclk->alt_parent if
rockchip_clk_register_cpuclk fails.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>

authored by

Shawn Lin and committed by
Heiko Stuebner
282312d1 36714529

+4 -2
+4 -2
drivers/clk/rockchip/clk-cpu.c
··· 290 290 pr_err("%s: could not lookup parent clock %s\n", 291 291 __func__, parent_names[0]); 292 292 ret = -EINVAL; 293 - goto free_cpuclk; 293 + goto free_alt_parent; 294 294 } 295 295 296 296 ret = clk_notifier_register(clk, &cpuclk->clk_nb); 297 297 if (ret) { 298 298 pr_err("%s: failed to register clock notifier for %s\n", 299 299 __func__, name); 300 - goto free_cpuclk; 300 + goto free_alt_parent; 301 301 } 302 302 303 303 if (nrates > 0) { ··· 326 326 kfree(cpuclk->rate_table); 327 327 unregister_notifier: 328 328 clk_notifier_unregister(clk, &cpuclk->clk_nb); 329 + free_alt_parent: 330 + clk_disable_unprepare(cpuclk->alt_parent); 329 331 free_cpuclk: 330 332 kfree(cpuclk); 331 333 return ERR_PTR(ret);