clk: visconti: Fix memory leak in visconti_register_pll()
authorXiu Jianfeng <xiujianfeng@huawei.com>
Tue, 22 Nov 2022 15:23:53 +0000 (23:23 +0800)
committerStephen Boyd <sboyd@kernel.org>
Tue, 29 Nov 2022 20:11:00 +0000 (12:11 -0800)
commitb55226f8553d255f5002c751c7c6ba9291f34bf2
tree4bda0f3f7b4103375e33de46bd41d1a9eb0837e5
parent12897adc8eea9e56e44482dcdf71d4c98a08dbde
clk: visconti: Fix memory leak in visconti_register_pll()

@pll->rate_table has allocated memory by kmemdup(), if clk_hw_register()
fails, it should be freed, otherwise it will cause memory leak issue,
this patch fixes it.

Fixes: b4cbe606dc36 ("clk: visconti: Add support common clock driver and reset driver")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Link: https://lore.kernel.org/r/20221122152353.204132-1-xiujianfeng@huawei.com
Acked-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/visconti/pll.c