[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20181226041319.73854-1-kjlu@umn.edu>
Date: Tue, 25 Dec 2018 22:13:18 -0600
From: Kangjie Lu <kjlu@....edu>
To: kjlu@....edu
Cc: pakki001@....edu, Thomas Gleixner <tglx@...utronix.de>,
John Stultz <john.stultz@...aro.org>,
Stephen Boyd <sboyd@...nel.org>, linux-kernel@...r.kernel.org
Subject: [PATCH] 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 <kjlu@....edu>
---
kernel/time/alarmtimer.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index fa5de5e8de61..19ba8a1633e0 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -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);
--
2.17.2 (Apple Git-113)
Powered by blists - more mailing lists