This is a note to let you know that I've just added the patch titled
clockevents: sun5i: Fix setup_irq init sequence
to the 3.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
clockevents-sun5i-fix-setup_irq-init-sequence.patch
and it can be found in the queue-3.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 1096be084ac59927158ce80ff1d31c33eed0e565 Mon Sep 17 00:00:00 2001
From: Yongbae Park <[email protected]>
Date: Tue, 3 Mar 2015 13:05:48 +0900
Subject: clockevents: sun5i: Fix setup_irq init sequence
From: Yongbae Park <[email protected]>
commit 1096be084ac59927158ce80ff1d31c33eed0e565 upstream.
The interrupt is enabled before the handler is set. Even this bug
did not appear, it is potentially dangerous as it can lead to a
NULL pointer dereference.
Fix the error by enabling the interrupt after
clockevents_config_and_register() is called.
Signed-off-by: Yongbae Park <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/clocksource/timer-sun5i.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/clocksource/timer-sun5i.c
+++ b/drivers/clocksource/timer-sun5i.c
@@ -172,10 +172,6 @@ static void __init sun5i_timer_init(stru
ticks_per_jiffy = DIV_ROUND_UP(rate, HZ);
- ret = setup_irq(irq, &sun5i_timer_irq);
- if (ret)
- pr_warn("failed to setup irq %d\n", irq);
-
/* Enable timer0 interrupt */
val = readl(timer_base + TIMER_IRQ_EN_REG);
writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);
@@ -185,6 +181,10 @@ static void __init sun5i_timer_init(stru
clockevents_config_and_register(&sun5i_clockevent, rate,
TIMER_SYNC_TICKS, 0xffffffff);
+
+ ret = setup_irq(irq, &sun5i_timer_irq);
+ if (ret)
+ pr_warn("failed to setup irq %d\n", irq);
}
CLOCKSOURCE_OF_DECLARE(sun5i_a13, "allwinner,sun5i-a13-hstimer",
sun5i_timer_init);
Patches currently in stable-queue which might be from [email protected] are
queue-3.14/clocksource-efm32-fix-a-null-pointer-dereference.patch
queue-3.14/clockevents-sun5i-fix-setup_irq-init-sequence.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html