diff options
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/lib.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/rtc/lib.c b/drivers/rtc/lib.c index e36c233455ee..23284580df97 100644 --- a/drivers/rtc/lib.c +++ b/drivers/rtc/lib.c | |||
@@ -94,6 +94,7 @@ EXPORT_SYMBOL(rtc_time64_to_tm); | |||
94 | int rtc_valid_tm(struct rtc_time *tm) | 94 | int rtc_valid_tm(struct rtc_time *tm) |
95 | { | 95 | { |
96 | if (tm->tm_year < 70 || | 96 | if (tm->tm_year < 70 || |
97 | tm->tm_year > (INT_MAX - 1900) || | ||
97 | ((unsigned int)tm->tm_mon) >= 12 || | 98 | ((unsigned int)tm->tm_mon) >= 12 || |
98 | tm->tm_mday < 1 || | 99 | tm->tm_mday < 1 || |
99 | tm->tm_mday > rtc_month_days(tm->tm_mon, | 100 | tm->tm_mday > rtc_month_days(tm->tm_mon, |