]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
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)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 23 Jun 2023 07:33:44 +0000 (09:33 +0200)
commit8b5bf64c89c7100c921bd807ba39b2eb003061ab
treeef62dd9a33a88ae887f8cf8710d0e7d5d41b39cd
parent6d0d4df8e7e1fe22d961d667c2bfa40c3d5022e8
clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe

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
drivers/clocksource/timer-cadence-ttc.c