mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 18:36:00 +00:00
clk: mediatek: Fix resource leak in mtk_clk_simple_probe
Release clock data when clock driver probe fail to fix possible resource leak. Signed-off-by: Chun-Jie Chen <chun-jie.chen@mediatek.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://lore.kernel.org/r/20210914021633.26377-6-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
300796cad2
commit
6203815bf9
@ -314,7 +314,15 @@ int mtk_clk_simple_probe(struct platform_device *pdev)
|
||||
|
||||
r = mtk_clk_register_gates(node, mcd->clks, mcd->num_clks, clk_data);
|
||||
if (r)
|
||||
return r;
|
||||
goto free_data;
|
||||
|
||||
return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
|
||||
r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
|
||||
if (r)
|
||||
goto free_data;
|
||||
|
||||
return r;
|
||||
|
||||
free_data:
|
||||
mtk_free_clk_data(clk_data);
|
||||
return r;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user