Skip to content

Commit 03c1c51

Browse files
tititiou36bebarino
authored andcommitted
clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe()
If an error occurs after mtk_alloc_clk_data(), mtk_free_clk_data() should be called, as already done in the remove function. Fixes: 54b7026 ("clk: mediatek: mt8135-apmixedsys: Convert to platform_driver and module") Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/6cd6af61e5a91598068227f1f68cfcfde1507453.1704615011.git.christophe.jaillet@wanadoo.fr Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 6613476 commit 03c1c51

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/clk/mediatek/clk-mt8135-apmixedsys.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int clk_mt8135_apmixed_probe(struct platform_device *pdev)
5959

6060
ret = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
6161
if (ret)
62-
return ret;
62+
goto free_clk_data;
6363

6464
ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
6565
if (ret)
@@ -69,6 +69,8 @@ static int clk_mt8135_apmixed_probe(struct platform_device *pdev)
6969

7070
unregister_plls:
7171
mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data);
72+
free_clk_data:
73+
mtk_free_clk_data(clk_data);
7274

7375
return ret;
7476
}

0 commit comments

Comments
 (0)