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: <20071026221028.1873.3005.stgit@localhost.localdomain>
Date:	Fri, 26 Oct 2007 15:10:28 -0700
From:	Auke Kok <auke-jan.h.kok@...el.com>
To:	shemminger@...ux-foundation.org
Cc:	netdev@...r.kernel.org
Subject: [PATCH] skye/skge: sparse fix - data can't ever be bigger than
	LONG_MAX / HZ

Trivial replacement - use INT_MAX instead here.

Signed-off-by: Auke Kok <auke-jan.h.kok@...el.com>
Cc: shemminger@...ux-foundation.org
---

 drivers/net/sk98lin/skethtool.c |    4 ++--
 drivers/net/skge.c              |    8 ++++----
 drivers/net/sky2.c              |    8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/sk98lin/skethtool.c b/drivers/net/sk98lin/skethtool.c
index 5a6da89..4549b97 100644
--- a/drivers/net/sk98lin/skethtool.c
+++ b/drivers/net/sk98lin/skethtool.c
@@ -430,8 +430,8 @@ static int locateDevice(struct net_device *dev, u32 data)
 	DEV_NET *pNet = netdev_priv(dev);
 	SK_AC *pAC = pNet->pAC;
 
-	if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
-		data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
+	if (!data)
+		data = INT_MAX;
 
 	/* start blinking */
 	pAC->LedsOn = 0;
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index b9961dc..696a79e 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -783,10 +783,10 @@ static int skge_phys_id(struct net_device *dev, u32 data)
 	unsigned long ms;
 	enum led_mode mode = LED_MODE_TST;
 
-	if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
-		ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT / HZ) * 1000;
-	else
-		ms = data * 1000;
+	if (!data)
+		data = INT_MAX;
+
+	ms = data * HZ;
 
 	while (ms > 0) {
 		skge_led(skge, mode);
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index c27c7d6..1381d04 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3336,10 +3336,10 @@ static int sky2_phys_id(struct net_device *dev, u32 data)
 	int interrupted;
 	int onoff = 1;
 
-	if (!data || data > (u32) (MAX_SCHEDULE_TIMEOUT / HZ))
-		ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT);
-	else
-		ms = data * 1000;
+	if (!data)
+		data = INT_MAX:
+
+	ms = data * HZ;
 
 	/* save initial values */
 	spin_lock_bh(&sky2->phy_lock);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ