diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2019-07-09 16:01:06 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-07-09 16:01:05 -0700 |
| commit | a18db927c67e6c992c3a80d54c53906b609acdb4 (patch) | |
| tree | da41ecc3057d6a5ca30b3001e4c8da34b1c21165 | |
| parent | 8f672181451ff8be47e6a2a66a684be121460dbf (diff) | |
| parent | bacd235ea66e67d2727a5929b1c68ac2f4d84b07 (diff) | |
Merge "clocksource: arm_arch_timer: Fix a NULL Pointer dereference"
| -rw-r--r-- | drivers/clocksource/arm_arch_timer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 6760f84faf06..bd55b201371e 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -752,7 +752,7 @@ CLOCKSOURCE_OF_DECLARE(armv8_arch_timer, "arm,armv8-timer", arch_timer_of_init); static void __init arch_timer_mem_init(struct device_node *np) { struct device_node *frame, *best_frame = NULL; - void __iomem *cntctlbase, *base; + void __iomem *cntctlbase, *base = NULL; unsigned int irq; u32 cnttidr; @@ -790,7 +790,8 @@ static void __init arch_timer_mem_init(struct device_node *np) best_frame = of_node_get(frame); } - base = arch_counter_base = of_iomap(best_frame, 0); + if (best_frame) + base = arch_counter_base = of_iomap(best_frame, 0); if (!base) { pr_err("arch_timer: Can't map frame's registers\n"); of_node_put(best_frame); |
