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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20170228121851.21145-1-colin.king@canonical.com>
Date:   Tue, 28 Feb 2017 12:18:51 +0000
From:   Colin King <colin.king@...onical.com>
To:     Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] net: bcmgenet: fix off-by-one comparison on timeout

From: Colin Ian King <colin.king@...onical.com>

At the end of the timeout loop, timeout will be 1001 and not 1000 and
so the timeout error will never be detected. Fix the off-by-one
comparison by checking to see if timeout is greater than 1000.

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index f928968..24e7201 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -1829,7 +1829,7 @@ static int reset_umac(struct bcmgenet_priv *priv)
 		udelay(1);
 	}
 
-	if (timeout == 1000) {
+	if (timeout > 1000) {
 		dev_err(kdev,
 			"timeout waiting for MAC to come out of reset\n");
 		return -ETIMEDOUT;
-- 
2.10.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ