summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2004-09-29 22:16:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-29 22:16:36 -0700
commit568c32850bf11644b4b660eeba7ae09496bff24d (patch)
treedb4aba8acf1478e058e764a1892d92d26fb3c6be
parent43403bb322aced46861641387394ade0f006ac9d (diff)
[PATCH] limit max jiffy of msecs_to_jiffies
-rw-r--r--include/linux/time.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/time.h b/include/linux/time.h
index 8bccdf73a97f..2111941c1af7 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -208,6 +208,8 @@ static inline unsigned int jiffies_to_usecs(const unsigned long j)
static inline unsigned long msecs_to_jiffies(const unsigned int m)
{
+ if (m > jiffies_to_msecs(MAX_JIFFY_OFFSET))
+ return MAX_JIFFY_OFFSET;
#if HZ <= 1000 && !(1000 % HZ)
return (m + (1000 / HZ) - 1) / (1000 / HZ);
#elif HZ > 1000 && !(HZ % 1000)