lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu,  8 May 2014 07:56:15 +0200
From:	Ales Novak <alnovak@...e.cz>
To:	Alessandro Zummo <a.zummo@...ertech.it>,
	Andrew Morton <akpm@...ux-foundation.org>
Cc:	rtc-linux@...glegroups.com, linux-kernel@...r.kernel.org,
	Jiri Kosina <jkosina@...e.cz>,
	John Stultz <john.stultz@...aro.org>,
	Ales Novak <alnovak@...e.cz>
Subject: [PATCH] drivers/rtc/interface.c: fix for fix of alarm initialization

Seems the previous patch "fix infinite loop in initializing the alarm"
did break the infinite loop in alarm initialization, but not in the right
way. The loop indeed should walk through the not-leap years and stop on
the leap one.

This patch does apply on top of the previous one.

Signed-off-by: Ales Novak <alnovak@...e.cz>
---
Fix for patch drivers-rtc-interfacec-fix-infinite-loop-in-initializing-the-alarm

 drivers/rtc/interface.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index a2df283..bd6314a 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -292,8 +292,7 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
 		dev_dbg(&rtc->dev, "alarm rollover: %s\n", "year");
 		do {
 			alarm->time.tm_year++;
-		} while (alarm->time.tm_mon == 1
-			&& is_leap_year(alarm->time.tm_year + 1900)
+		} while (!is_leap_year(alarm->time.tm_year + 1900)
 			&& rtc_valid_tm(&alarm->time) != 0);
 		break;
 
-- 
1.8.1.4

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ