]> git.ipfire.org Git - thirdparty/linux.git/commit
clk: mediatek: mt6735-apmixedsys: Fix an error handling path in clk_mt6735_apmixed_pr...
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 25 Oct 2024 15:46:08 +0000 (17:46 +0200)
committerStephen Boyd <sboyd@kernel.org>
Thu, 14 Nov 2024 20:51:47 +0000 (12:51 -0800)
commitbe530c3fc296f35e67f0f799029ba17880dd3f50
tree8aaee1d6b1c6f09666696c47842e18e5a5b69fbc
parent198675bbc03d437fb80a35d781ad13d622d0ff68
clk: mediatek: mt6735-apmixedsys: Fix an error handling path in clk_mt6735_apmixed_probe()

If an error occurs after a successful mtk_alloc_clk_data(),
mtk_free_clk_data() should be called, as already done in the .remove()
function.

Switch to mtk_devm_alloc_clk_data() in order to fix the memory leak in the
probe function, and simplify the remove function.

Fixes: 43c04ed79189 ("clk: mediatek: Add drivers for MediaTek MT6735 main clock and reset drivers")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/89ad840e7a484eaf4727470824acfe0fdc60fcef.1729871146.git.christophe.jaillet@wanadoo.fr
Tested-by: Yassine Oudjana <y.oudjana@protonmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/mediatek/clk-mt6735-apmixedsys.c