time: fix a missing check of rtc_read_time
PATCH 1/1 time: fix a missing check of rtc_read_time
When rtc_read_time fails, we shouldn't use it read time. The fix returns with its error code when it fails.
Signed-off-by Kangjie Lu <[email protected]>
--- kernel/time/alarmtimer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/time/alarmtimer.c +3 -1
@@ -293,7 +293,9 @@ static int alarmtimer_suspend(struct device *dev)/* Setup an rtc timer to fire that far in the future */ rtc_timer_cancel (rtc, &rtctimer); -rtc_read_time (rtc, &tm); + ret =rtc_read_time (rtc, &tm); +if (ret <0 ) +return ret; now =rtc_tm_to_ktime (tm); now =ktime_add (now, min);
Signature · 1 line
2.17.2 (Apple Git-113)