clk: st: Fix memory leak in st_of_quadfs_setup()
authorXiu Jianfeng <xiujianfeng@huawei.com>
Tue, 22 Nov 2022 13:36:14 +0000 (21:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 08:26:33 +0000 (09:26 +0100)
commitf0295209de457049a4a5f3e3985528391bd1ab34
treee0793478a55cb1cf59f1a6b35c65e07b7ee17d29
parent8c6151b8e8dd2d98ad2cd725d26d1e103d989891
clk: st: Fix memory leak in st_of_quadfs_setup()

[ Upstream commit cfd3ffb36f0d566846163118651d868e607300ba ]

If st_clk_register_quadfs_pll() fails, @lock should be freed before goto
@err_exit, otherwise will cause meory leak issue, fix it.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Link: https://lore.kernel.org/r/20221122133614.184910-1-xiujianfeng@huawei.com
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/st/clkgen-fsyn.c