clocksource: dbx500-prcmu: check timer register mapping
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.
--- drivers/clocksource/clksrc-dbx500-prcmu.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clocksource/clksrc-dbx500-prcmu.c +2 -0
@@ -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
Quoted 8 lines · Slavin Liu
Return
-ENOMEMifof_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 LLMSigned-off-by Slavin Liu <[email protected]>
Yours,
Linus Walleij
Daniel Lezcano
AppliedQuoted 9 lines · Slavin Liu
Return
-ENOMEMifof_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 LLMSigned-off-by Slavin Liu <[email protected]>---
Applied, thanks
[clocksource: timers/drivers/next] clocksource/drivers/dbx500-prcmu: Check timer register mapping
In reply to Slavin LiuThe 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.
--- drivers/clocksource/clksrc-dbx500-prcmu.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clocksource/clksrc-dbx500-prcmu.c +2 -0
@@ -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