mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
clocksource/drivers/qcom: Add missing iounmap() on errors in msm_dt_timer_init()
[ Upstream commit ca140a0dc0a18acd4653b56db211fec9b2339986 ]
Add the missing iounmap() when clock frequency fails to get read by the
of_property_read_u32() call, or if the call to msm_timer_init() fails.
Fixes: 6e3321631a ("ARM: msm: Add DT support to msm_timer")
Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240713095713.GA430091@bnew-VirtualBox
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
22a0ee419b
commit
3125e582df
@@ -233,6 +233,7 @@ static int __init msm_dt_timer_init(struct device_node *np)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (of_property_read_u32(np, "clock-frequency", &freq)) {
|
if (of_property_read_u32(np, "clock-frequency", &freq)) {
|
||||||
|
iounmap(cpu0_base);
|
||||||
pr_err("Unknown frequency\n");
|
pr_err("Unknown frequency\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -243,7 +244,11 @@ static int __init msm_dt_timer_init(struct device_node *np)
|
|||||||
freq /= 4;
|
freq /= 4;
|
||||||
writel_relaxed(DGT_CLK_CTL_DIV_4, source_base + DGT_CLK_CTL);
|
writel_relaxed(DGT_CLK_CTL_DIV_4, source_base + DGT_CLK_CTL);
|
||||||
|
|
||||||
return msm_timer_init(freq, 32, irq, !!percpu_offset);
|
ret = msm_timer_init(freq, 32, irq, !!percpu_offset);
|
||||||
|
if (ret)
|
||||||
|
iounmap(cpu0_base);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
TIMER_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init);
|
TIMER_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init);
|
||||||
TIMER_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init);
|
TIMER_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init);
|
||||||
|
|||||||
Reference in New Issue
Block a user