lkml.org 
[lkml]   [2014]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] RTC: Fix infinite loop in initializing the alarm.
On Tue,  8 Apr 2014 00:54:42 +0200
Ales Novak <alnovak@suse.cz> wrote:

> In __rtc_read_alarm(), if the alarm time retrieved by
> rtc_read_alarm_internal() from the device contains invalid values
> (e.g. month=2,mday=31) and the year not set (=-1), the initialization
> will loop infinitely because the year-fixing loop expects the
> time being invalid due to leap year.
>
> Fix reduces the loop to the leap years and adds final validity check.
>
> Signed-off-by: Ales Novak <alnovak@suse.cz>

Seems reasonable.

Acked-by: Alessandro Zummo <a.zummo@towertech.it>

--

Best regards,

Alessandro Zummo,
Tower Technologies - Torino, Italy

http://www.towertech.it



\
 
 \ /
  Last update: 2014-04-08 18:01    [W:0.051 / U:3.932 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site