rtc: Check return value from mc146818_get_time()
[linux-2.6-microblaze.git] / arch / x86 / kernel / hpet.c
index 882213d..71f3364 100644 (file)
@@ -1435,8 +1435,12 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
        hpet_rtc_timer_reinit();
        memset(&curr_time, 0, sizeof(struct rtc_time));
 
-       if (hpet_rtc_flags & (RTC_UIE | RTC_AIE))
-               mc146818_get_time(&curr_time);
+       if (hpet_rtc_flags & (RTC_UIE | RTC_AIE)) {
+               if (unlikely(mc146818_get_time(&curr_time) < 0)) {
+                       pr_err_ratelimited("unable to read current time from RTC\n");
+                       return IRQ_HANDLED;
+               }
+       }
 
        if (hpet_rtc_flags & RTC_UIE &&
            curr_time.tm_sec != hpet_prev_update_sec) {