mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-26 12:26:11 +00:00
clk: st: Fix memory leak in st_of_quadfs_setup()
[ Upstream commit cfd3ffb36f
]
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>
This commit is contained in:
parent
63648a7bd1
commit
335ef7546c
1 changed files with 3 additions and 2 deletions
|
@ -1020,9 +1020,10 @@ static void __init st_of_quadfs_setup(struct device_node *np,
|
|||
|
||||
clk = st_clk_register_quadfs_pll(pll_name, clk_parent_name, datac->data,
|
||||
reg, lock);
|
||||
if (IS_ERR(clk))
|
||||
if (IS_ERR(clk)) {
|
||||
kfree(lock);
|
||||
goto err_exit;
|
||||
else
|
||||
} else
|
||||
pr_debug("%s: parent %s rate %u\n",
|
||||
__clk_get_name(clk),
|
||||
__clk_get_name(clk_get_parent(clk)),
|
||||
|
|
Loading…
Reference in a new issue