public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe()
@ 2024-01-07  8:12 Christophe JAILLET
  2024-01-08 10:14 ` AngeloGioacchino Del Regno
  2024-02-22  4:51 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2024-01-07  8:12 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger,
	AngeloGioacchino Del Regno, Chen-Yu Tsai
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-clk,
	linux-arm-kernel, linux-mediatek

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>
---
 drivers/clk/mediatek/clk-mt8135-apmixedsys.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe()
  2024-01-07  8:12 [PATCH] clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe() Christophe JAILLET
@ 2024-01-08 10:14 ` AngeloGioacchino Del Regno
  2024-02-22  4:51 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-01-08 10:14 UTC (permalink / raw)
  To: Christophe JAILLET, Michael Turquette, Stephen Boyd,
	Matthias Brugger, Chen-Yu Tsai
  Cc: linux-kernel, kernel-janitors, linux-clk, linux-arm-kernel,
	linux-mediatek

Il 07/01/24 09:12, Christophe JAILLET ha scritto:
> 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>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe()
  2024-01-07  8:12 [PATCH] clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe() Christophe JAILLET
  2024-01-08 10:14 ` AngeloGioacchino Del Regno
@ 2024-02-22  4:51 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2024-02-22  4:51 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, Chen-Yu Tsai, Christophe JAILLET,
	Matthias Brugger, Michael Turquette
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-clk,
	linux-arm-kernel, linux-mediatek

Quoting Christophe JAILLET (2024-01-07 00:12:17)
> 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>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-22  4:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-07  8:12 [PATCH] clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe() Christophe JAILLET
2024-01-08 10:14 ` AngeloGioacchino Del Regno
2024-02-22  4:51 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox