Skip to content

Commit

Permalink
timer: Setup uninitialized timer with a stub callback
Browse files Browse the repository at this point in the history
Remove the WARN_ON() in timer_fixup_activate() as we now get the
debugobjects printout in the debugobjects activate check.

We also assign a dummy timer callback so that if the timer is
actually set to fire we don't oops.

[ tglx@linutronix.de: Split out the debugobjects vs. the timer change ]

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Christine Chan <cschan@codeaurora.org>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1320724108-20788-2-git-send-email-sboyd@codeaurora.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Stephen Boyd authored and Thomas Gleixner committed Nov 23, 2011
1 parent b84d435 commit fb16b8c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,12 @@ static int timer_fixup_init(void *addr, enum debug_obj_state state)
}
}

/* Stub timer callback for improperly used timers. */
static void stub_timer(unsigned long data)
{
WARN_ON(1);
}

/*
* fixup_activate is called when:
* - an active object is activated
Expand All @@ -450,7 +456,8 @@ static int timer_fixup_activate(void *addr, enum debug_obj_state state)
debug_object_activate(timer, &timer_debug_descr);
return 0;
} else {
WARN_ON_ONCE(1);
setup_timer(timer, stub_timer, 0);
return 1;
}
return 0;

Expand Down

0 comments on commit fb16b8c

Please sign in to comment.