]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
clocksource/drivers/cadence_ttc: Fix memory leak in ttc_setup_clockevent()
authorYu Kuai <yukuai3@huawei.com>
Mon, 16 Nov 2020 13:51:23 +0000 (21:51 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Jan 2021 13:25:56 +0000 (14:25 +0100)
commit887b920a02fd8b4cc7cccf214ffa4b75c768cc86
tree35d3668f4cbc4168155bfe88e1a353d134e841da
parentfef9168fe94178cf9ce55895e8b463578c08e0d8
clocksource/drivers/cadence_ttc: Fix memory leak in ttc_setup_clockevent()

BugLink: https://bugs.launchpad.net/bugs/1910822
[ Upstream commit eee422c46e6840a81c9db18a497b74387a557b29 ]

If clk_notifier_register() failed, ttc_setup_clockevent() will return
without freeing 'ttcce', which will leak memory.

Fixes: 70504f311d4b ("clocksource/drivers/cadence_ttc: Convert init function to return error")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201116135123.2164033-1-yukuai3@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/clocksource/timer-cadence-ttc.c