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

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: 54b7026f011e ("clk: mediatek: mt8135-apmixedsys: Convert to platform_driver and module")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/6cd6af61e5a91598068227f1f68cfcfde1507453.1704615011.git.christophe.jaillet@wanadoo.fr
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Christophe JAILLET and committed by
Stephen Boyd
03c1c51e 6613476e

+3 -1
+3 -1
drivers/clk/mediatek/clk-mt8135-apmixedsys.c
··· 59 59 60 60 ret = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); 61 61 if (ret) 62 - return ret; 62 + goto free_clk_data; 63 63 64 64 ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); 65 65 if (ret) ··· 69 69 70 70 unregister_plls: 71 71 mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data); 72 + free_clk_data: 73 + mtk_free_clk_data(clk_data); 72 74 73 75 return ret; 74 76 }