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

Configure Feed

Select the types of activity you want to include in your feed.

clk: spear: fix resource leak in clk_register_vco_pll()

Add a goto label in clk_register_vco_pll(), unregister vco_clk
if tpll_clk is failed to be registered.

Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20260325062204.169648-1-lihaoxiang@isrc.iscas.ac.cn
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Haoxiang Li and committed by
Arnd Bergmann
a0ac82cb c7091fd5

+3 -1
+3 -1
drivers/clk/spear/clk-vco-pll.c
··· 343 343 344 344 tpll_clk = clk_register(NULL, &pll->hw); 345 345 if (IS_ERR_OR_NULL(tpll_clk)) 346 - goto free_pll; 346 + goto unregister_clk; 347 347 348 348 if (pll_clk) 349 349 *pll_clk = tpll_clk; 350 350 351 351 return vco_clk; 352 352 353 + unregister_clk: 354 + clk_unregister(vco_clk); 353 355 free_pll: 354 356 kfree(pll); 355 357 free_vco: