]> git.itanic.dy.fi Git - linux-stable/commit
rtc: sun6i: Fix memleak in sun6i_rtc_clk_init
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Tue, 20 Oct 2020 06:12:26 +0000 (14:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Jan 2021 12:37:38 +0000 (13:37 +0100)
commit3ce2fd56bb342f15cc2184ec321610546bfe6f26
treee86d93c06a5702fdc38a46dd985e8350c00ce710
parentc5eae3edc5273ac59dab70fd49114cce729f27f4
rtc: sun6i: Fix memleak in sun6i_rtc_clk_init

[ Upstream commit 28d211919e422f58c1e6c900e5810eee4f1ce4c8 ]

When clk_hw_register_fixed_rate_with_accuracy() fails,
clk_data should be freed. It's the same for the subsequent
two error paths, but we should also unregister the already
registered clocks in them.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201020061226.6572-1-dinghao.liu@zju.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-sun6i.c