clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe
authorFeng Mingxi <m202271825@hust.edu.cn>
Tue, 25 Apr 2023 06:56:11 +0000 (06:56 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:20:59 +0000 (16:20 +0200)
commit919dd531ebb7514f205ae7aab87994337ebce1f6
tree61cf0fb0af5fc1ba484fe3c8c3bb0e45f1b3e0f8
parent2d3f42d22f32dde0ba565239e12edf39310739ce
clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe

[ Upstream commit 8b5bf64c89c7100c921bd807ba39b2eb003061ab ]

Smatch reports:
drivers/clocksource/timer-cadence-ttc.c:529 ttc_timer_probe()
warn: 'timer_baseaddr' from of_iomap() not released on lines: 498,508,516.

timer_baseaddr may have the problem of not being released after use,
I replaced it with the devm_of_iomap() function and added the clk_put()
function to cleanup the "clk_ce" and "clk_cs".

Fixes: e932900a3279 ("arm: zynq: Use standard timer binding")
Fixes: 70504f311d4b ("clocksource/drivers/cadence_ttc: Convert init function to return error")
Signed-off-by: Feng Mingxi <m202271825@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230425065611.702917-1-m202271825@hust.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clocksource/timer-cadence-ttc.c