[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1404436946-28354-1-git-send-email-hyogi.gim@lge.com>
Date: Fri, 4 Jul 2014 10:22:26 +0900
From: Hyogi Gim <hyogi.gim@....com>
To: Alessandro Zummo <a.zummo@...ertech.it>,
John Stultz <john.stultz@...aro.org>
Cc: rtc-linux@...glegroups.com, linux-kernel@...r.kernel.org,
Hyogi Gim <hyogi.gim@....com>
Subject: [PATCH] drivers/rtc/interface.c: check the error after __rtc_read_time()
In __rtc_set_alarm(), the error after __rtc_read_time() is not checked.
If rtc device fail to read time, we cannot guarantee the following process.
Add the verification code for returned __rtc_read_time() error.
Signed-off-by: Hyogi Gim <hyogi.gim@....com>
---
drivers/rtc/interface.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 5813fa5..5b2717f 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -348,6 +348,8 @@ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
/* Make sure we're not setting alarms in the past */
err = __rtc_read_time(rtc, &tm);
+ if (err)
+ return err;
rtc_tm_to_time(&tm, &now);
if (scheduled <= now)
return -ETIME;
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists