Re: [PATCH] RTC: Fix infinite loop in initializing the alarm.

From: Alessandro Zummo
Date: Tue Apr 08 2014 - 10:43:24 EST


On Tue, 8 Apr 2014 00:54:42 +0200
Ales Novak <alnovak@xxxxxxx> 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@xxxxxxx>

Seems reasonable.

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

--

Best regards,

Alessandro Zummo,
Tower Technologies - Torino, Italy

http://www.towertech.it

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/