MIPS: Alchemy: Fix memleak in alchemy_clk_setup_cpu
authorZhang Qilong <zhangqilong3@huawei.com>
Fri, 13 Nov 2020 13:18:56 +0000 (21:18 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 17 Nov 2020 11:53:57 +0000 (12:53 +0100)
commitac3b57adf87ad9bac7e33ca26bbbb13fae1ed62b
treebcc067bf053fd37cd99a3806b492c4b4c04f6406
parent61a2f1aecf6052f7bcf900829ca2b9d74437ec07
MIPS: Alchemy: Fix memleak in alchemy_clk_setup_cpu

If the clk_register fails, we should free h before
function returns to prevent memleak.

Fixes: 474402291a0ad ("MIPS: Alchemy: clock framework integration of onchip clocks")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/alchemy/common/clock.c