Messages in this thread Patch in this message | | | From | Hyogi Gim <> | Subject | [PATCH] drivers/rtc/interface.c: check the error after __rtc_read_time() | Date | Fri, 4 Jul 2014 10:22:26 +0900 |
| |
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@lge.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
| |