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>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
 
        /* 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;