From 568c32850bf11644b4b660eeba7ae09496bff24d Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 29 Sep 2004 22:16:36 -0700 Subject: [PATCH] [PATCH] limit max jiffy of msecs_to_jiffies --- include/linux/time.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/time.h b/include/linux/time.h index 8bccdf73a97fc..2111941c1af7e 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) -- 2.53.0