]> git.baikalelectronics.ru Git - kernel.git/commit
clk: rockchip: Fix memory leak in rockchip_clk_register_pll()
authorXiu Jianfeng <xiujianfeng@huawei.com>
Wed, 23 Nov 2022 09:12:01 +0000 (17:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:05 +0000 (11:41 +0100)
commit3cd05b79da794fee963d4657de9054bc2e8bd69a
treeb6c299229f65e90a1d71eff65aa88362632935cf
parent804283e7fb522649b83d32a92f928385863bfe79
clk: rockchip: Fix memory leak in rockchip_clk_register_pll()

[ Upstream commit 26e24c4a06c46223b349606268e2a320e40fb543 ]

If clk_register() fails, @pll->rate_table may have allocated memory by
kmemdup(), so it needs to be freed, otherwise will cause memory leak
issue, this patch fixes it.

Fixes: 3961a42600c7 ("clk: rockchip: add clock type for pll clocks and pll used on rk3066")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Link: https://lore.kernel.org/r/20221123091201.199819-1-xiujianfeng@huawei.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/rockchip/clk-pll.c