diff options
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r-- | drivers/rtc/interface.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 8e286259a007..8a1c031391d6 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c | |||
@@ -228,11 +228,11 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) | |||
228 | alarm->time.tm_hour = now.tm_hour; | 228 | alarm->time.tm_hour = now.tm_hour; |
229 | 229 | ||
230 | /* For simplicity, only support date rollover for now */ | 230 | /* For simplicity, only support date rollover for now */ |
231 | if (alarm->time.tm_mday == -1) { | 231 | if (alarm->time.tm_mday < 1 || alarm->time.tm_mday > 31) { |
232 | alarm->time.tm_mday = now.tm_mday; | 232 | alarm->time.tm_mday = now.tm_mday; |
233 | missing = day; | 233 | missing = day; |
234 | } | 234 | } |
235 | if (alarm->time.tm_mon == -1) { | 235 | if ((unsigned)alarm->time.tm_mon >= 12) { |
236 | alarm->time.tm_mon = now.tm_mon; | 236 | alarm->time.tm_mon = now.tm_mon; |
237 | if (missing == none) | 237 | if (missing == none) |
238 | missing = month; | 238 | missing = month; |