Skip to contentSkip to conversation

clocksource: dbx500-prcmu: check timer register mapping

RFC PATCH Applied Slavin Liu 4 participants 4 messages Sep 11 – Oct 14

Subsystems (2)
lore
Share & tools
lore

Slavin Liu

author
#0 lore raw

RFC PATCH 1/1 clocksource: 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
---
 drivers/clocksource/clksrc-dbx500-prcmu.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clocksource/clksrc-dbx500-prcmu.c +2 -0
index 2fc93e46cea3..1af223b0e896 100644
@@ -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
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Slavin Liu

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

Yours,
Linus Walleij

#2 lore raw
In reply to Slavin Liu
Quoted 9 lines · Slavin Liu

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

---

Applied, thanks

#3 lore raw

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

In reply to Slavin Liu
The following commit has been merged into the timers/drivers/next branch of clocksource:

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 <[email protected]>
AuthorDate:    Fri, 11 Sep 2026 14:09:17 +08:00
Committer:     Daniel Lezcano <[email protected]>
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
---
 drivers/clocksource/clksrc-dbx500-prcmu.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clocksource/clksrc-dbx500-prcmu.c +2 -0
index 2fc93e4..1af223b 100644
@@ -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