From: Emilio López <
tu...@tuxfamily.org>
If we kexec the kernel, we are more likely to get an IRQ handle
request without a valid handler pointer set up. Make sure the
pointer is valid before running it.
arch/arm/mach-msm/timer.c takes the same approach.
Signed-off-by: Emilio López <
tu...@tuxfamily.org>
---
arch/arm/mach-sun4i/clock/aw_clocksrc.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-sun4i/clock/aw_clocksrc.c b/arch/arm/mach-sun4i/clock/aw_clocksrc.c
index eee0227..7b222ba 100644
--- a/arch/arm/mach-sun4i/clock/aw_clocksrc.c
+++ b/arch/arm/mach-sun4i/clock/aw_clocksrc.c
@@ -174,6 +174,8 @@ static void aw_set_clkevt_mode(enum clock_event_mode mode, struct clock_event_de
break;
}
+ case CLOCK_EVT_MODE_SHUTDOWN:
+ case CLOCK_EVT_MODE_UNUSED:
default:
{
/* disable clock event device */
@@ -253,9 +255,12 @@ static irqreturn_t aw_clkevt_irq(int irq, void *handle)
CLKSRC_DBG("aw_clkevt_irq!\n");
/* clear pending */
TMR_REG_IRQ_STAT = (1<<1);
+
+ if(unlikely(aw_clock_event.event_handler == NULL))
+ return IRQ_HANDLED;
+
/* clock event interrupt handled */
aw_clock_event.event_handler(&aw_clock_event);
-
return IRQ_HANDLED;
}
--
1.7.5.4