Message ID | 1404436946-28354-1-git-send-email-hyogi.gim@lge.com |
---|---|
State | Accepted |
Commit | ca6dc2dab97133b874c2f6a76b6125497b67b429 |
Headers | show |
On Fri, 4 Jul 2014 10:22:26 +0900 Hyogi Gim <hyogi.gim@lge.com> wrote: > 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>
On Thu, Jul 3, 2014 at 6:22 PM, Hyogi Gim <hyogi.gim@lge.com> wrote: > 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> Thanks for sending this in. Sorry I didn't get to it earlier. I've got it queued for testing and hopefully will make it for 3.17 (but I may be cutting it close). thanks -john -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
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;
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(+)