Commit 15d2bace5ec907530a3d0e0cf4bb1bd29f3ad7b7

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent 2ca7d93bb2

[PATCH] add_timer() of a pending timer is illegal

In the recent timer rework we lost the check for an add_timer() of an
already-pending timer.  That check was useful for networking, so put it back.

Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

include/linux/timer.h
... ... @@ -78,8 +78,9 @@
78 78 * Timers with an ->expired field in the past will be executed in the next
79 79 * timer tick.
80 80 */
81   -static inline void add_timer(struct timer_list * timer)
  81 +static inline void add_timer(struct timer_list *timer)
82 82 {
  83 + BUG_ON(timer_pending(timer));
83 84 __mod_timer(timer, timer->expires);
84 85 }
85 86