Commit 3d15fd75 authored by Ben Dooks's avatar Ben Dooks Committed by Russell King

[ARM PATCH] 2132/1: Fix timer NULL pointer de-reference on suspend

Patch from Ben Dooks

Timer suspend code fails to check for NULL before
calling the timer implementor's suspend or resume hooks.

Signed-off-by: Ben Dooks 
parent 492ac38a
......@@ -351,14 +351,20 @@ void timer_tick(struct pt_regs *regs)
static int timer_suspend(struct sys_device *dev, u32 state)
{
struct sys_timer *timer = container_of(dev, struct sys_timer, dev);
timer->suspend();
if (timer->suspend != NULL)
timer->suspend();
return 0;
}
static int timer_resume(struct sys_device *dev)
{
struct sys_timer *timer = container_of(dev, struct sys_timer, dev);
timer->resume();
if (timer->resume != NULL)
timer->resume();
return 0;
}
#else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment