Ales Novak ee1d901468 drivers/rtc/interface.c: fix infinite loop in initializing the alarm
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>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Reported-by: Jiri Bohac <jbohac@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-06-06 16:08:06 -07:00
..
2014-06-02 16:35:49 -07:00
2014-06-04 10:02:38 -07:00
2014-06-02 16:35:49 -07:00
2014-06-04 09:08:25 -07:00
2014-06-03 11:09:43 -07:00
2014-06-03 08:34:00 -07:00
2014-06-02 16:15:12 -07:00
2014-05-27 17:38:11 -07:00
2014-06-04 09:08:25 -07:00
2014-06-02 09:22:24 -07:00
2014-06-05 16:15:33 -07:00
2014-05-12 00:27:26 -04:00
2014-06-03 11:44:48 -07:00
2014-06-02 16:35:49 -07:00
2014-05-26 21:27:09 +02:00
2014-05-27 14:11:06 -07:00
2014-06-04 09:07:08 -07:00