[clocksource: timers/drivers/next] clocksource/drivers/dbx500-prcmu: Check timer register mapping

From: clocksource-bot for Slavin Liu

Date: Wed Oct 14 2026 - 16:23:49 EST


The following commit has been merged into the timers/drivers/next branch of clocksource:

Commit-ID: 8f30b035a6676e292ee8e54334711d9905dd0495
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/daniel.lezcano/linux.git//8f30b035a6676e292ee8e54334711d9905dd0495
Author: Slavin Liu <bolin.liu@xxxxxxxxxx>
AuthorDate: Fri, 11 Sep 2026 14:09:17 +08:00
Committer: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
CommitterDate: Fri, 02 Oct 2026 12:05:28 +02:00

clocksource/drivers/dbx500-prcmu: Check timer register mapping

Return -ENOMEM if of_iomap() fails, before reading or configuring
the timer register block.

Detected by static analysis and reviewed with AI-assisted source auditing.

Fixes: 9d2aa8c7961a ("ARM/clocksource: use automatic DT probing for ux500 PRCMU")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@xxxxxxxxxx>
Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>
Link: https://patch.msgid.link/20260911060917.94310-1-bolin.liu@xxxxxxxxxx
---
drivers/clocksource/clksrc-dbx500-prcmu.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/clksrc-dbx500-prcmu.c b/drivers/clocksource/clksrc-dbx500-prcmu.c
index 2fc93e4..1af223b 100644
--- a/drivers/clocksource/clksrc-dbx500-prcmu.c
+++ b/drivers/clocksource/clksrc-dbx500-prcmu.c
@@ -52,6 +52,8 @@ static struct clocksource clocksource_dbx500_prcmu = {
static int __init clksrc_dbx500_prcmu_init(struct device_node *node)
{
clksrc_dbx500_timer_base = of_iomap(node, 0);
+ if (!clksrc_dbx500_timer_base)
+ return -ENOMEM;

/*
* The A9 sub system expects the timer to be configured as