summaryrefslogtreecommitdiffstats
path: root/kernel/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/timer.c')
-rw-r--r--kernel/timer.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index 6b8538715..00ab398b4 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -180,17 +180,15 @@ void add_timer(struct timer_list *timer)
unsigned long flags;
spin_lock_irqsave(&timerlist_lock, flags);
- if (timer->list.next)
+ if (timer_pending(timer))
goto bug;
internal_add_timer(timer);
-out:
spin_unlock_irqrestore(&timerlist_lock, flags);
return;
-
bug:
+ spin_unlock_irqrestore(&timerlist_lock, flags);
printk("bug: kernel timer added twice at %p.\n",
__builtin_return_address(0));
- goto out;
}
static inline int detach_timer (struct timer_list *timer)