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-next>] [day] [month] [year] [list]
Message-Id: <1494262682-5401-1-git-send-email-karim.eshapa@gmail.com>
Date:   Mon,  8 May 2017 18:58:02 +0200
From:   Karim Eshapa <karim.eshapa@...il.com>
To:     inaky.perez-gonzalez@...el.com
Cc:     linux-wimax@...el.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Karim Eshapa <karim.eshapa@...il.com>
Subject: [PATCH] drivers: net: wimax: i2400m: i2400m-usb: Use time_after for time comparison

cast timeframe variable with (unsigned long) then
use time_after() kernel macro for time comparison.

Signed-off-by: Karim Eshapa <karim.eshapa@...il.com>
---
 drivers/net/wimax/i2400m/i2400m-usb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h
index 649ecad..6fc941c 100644
--- a/drivers/net/wimax/i2400m/i2400m-usb.h
+++ b/drivers/net/wimax/i2400m/i2400m-usb.h
@@ -131,7 +131,7 @@ static inline int edc_inc(struct edc *edc, u16 max_err, u16 timeframe)
 	unsigned long now;
 
 	now = jiffies;
-	if (now - edc->timestart > timeframe) {
+	if (time_after(now - edc->timestart, (unsigned long)timeframe)) {
 		edc->errorcount = 1;
 		edc->timestart = now;
 	} else if (++edc->errorcount > max_err) {
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ