diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-01-07 09:12:17 +0100 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2024-03-26 18:19:50 -0400 |
commit | 19a66e36c228b78c7593820fb4326a26fc8d6b10 (patch) | |
tree | 90c594a0d8f63fd0eb28dd135f1d3b6330c44200 /drivers | |
parent | 95d1f1228c1bb54803ae57525b76db60e99b37e4 (diff) | |
download | linux-stable-19a66e36c228b78c7593820fb4326a26fc8d6b10.tar.gz linux-stable-19a66e36c228b78c7593820fb4326a26fc8d6b10.tar.bz2 linux-stable-19a66e36c228b78c7593820fb4326a26fc8d6b10.zip |
clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe()
[ Upstream commit 03c1c51eba6be49b42816af9db114553131af6c8 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/mediatek/clk-mt8135-apmixedsys.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/clk/mediatek/clk-mt8135-apmixedsys.c b/drivers/clk/mediatek/clk-mt8135-apmixedsys.c index d1239b4b3db7..41bb2d2e2ea7 100644 --- a/drivers/clk/mediatek/clk-mt8135-apmixedsys.c +++ b/drivers/clk/mediatek/clk-mt8135-apmixedsys.c @@ -59,7 +59,7 @@ static int clk_mt8135_apmixed_probe(struct platform_device *pdev) ret = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); if (ret) - return ret; + goto free_clk_data; ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); if (ret) @@ -69,6 +69,8 @@ static int clk_mt8135_apmixed_probe(struct platform_device *pdev) unregister_plls: mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data); +free_clk_data: + mtk_free_clk_data(clk_data); return ret; } |