From: Ales Novak Date: Fri, 6 Jun 2014 21:35:39 +0000 (-0700) Subject: drivers/rtc/interface.c: fix infinite loop in initializing the alarm X-Git-Tag: omap-for-v3.16/fixes-against-rc1~91^2~4^2~166 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee1d90146815fdc8d653c558b327fff2acba041d;p=pandora-kernel.git 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 Acked-by: Alessandro Zummo Reported-by: Jiri Bohac Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed