diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2007-12-07 13:16:17 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-12-07 13:16:17 -0500 |
commit | 167b1de3ee4e50d65a2bd0a2667c9cd48faf54f3 (patch) | |
tree | f1bdad90f0bb39fcaa9b2d6eed12fe2a0bb9d48e /kernel/time | |
parent | 62f0f61e6673e67151a7c8c0f9a09c7ea43fe2b5 (diff) |
clockevents: warn once when program_event() is called with negative expiry
The hrtimer problem with large relative timeouts resulting in a
negative expiry time went unnoticed as there is no check in the
clockevents_program_event() code. Put a check there with a WARN_ONCE
to avoid such problems in the future.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/clockevents.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 822beebe664a..5fb139fef9fa 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -78,6 +78,11 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires, | |||
78 | unsigned long long clc; | 78 | unsigned long long clc; |
79 | int64_t delta; | 79 | int64_t delta; |
80 | 80 | ||
81 | if (unlikely(expires.tv64 < 0)) { | ||
82 | WARN_ON_ONCE(1); | ||
83 | return -ETIME; | ||
84 | } | ||
85 | |||
81 | delta = ktime_to_ns(ktime_sub(expires, now)); | 86 | delta = ktime_to_ns(ktime_sub(expires, now)); |
82 | 87 | ||
83 | if (delta <= 0) | 88 | if (delta <= 0) |