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: <20220519204017.15586-1-paskripkin@gmail.com>
Date:   Thu, 19 May 2022 23:40:17 +0300
From:   Pavel Skripkin <paskripkin@...il.com>
To:     vladimir.oltean@....com, claudiu.manoil@....com,
        alexandre.belloni@...tlin.com, UNGLinuxDriver@...rochip.com
Cc:     davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
        dan.carpenter@...cle.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Pavel Skripkin <paskripkin@...il.com>
Subject: [PATCH] net: ocelot: fix wront time_after usage

Accidentally noticed, that this driver is the only user of
while (timer_after(jiffies...)).

It looks like typo, because likely this while loop will finish after 1st
iteration, because time_after() returns true when 1st argument _is after_
2nd one.

Fix it by negating time_after return value inside while loops statement

Fixes: 753a026cfec1 ("net: ocelot: add FDMA support")
Signed-off-by: Pavel Skripkin <paskripkin@...il.com>
---
 drivers/net/ethernet/mscc/ocelot_fdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mscc/ocelot_fdma.c b/drivers/net/ethernet/mscc/ocelot_fdma.c
index dffa597bffe6..4500fed3ce5c 100644
--- a/drivers/net/ethernet/mscc/ocelot_fdma.c
+++ b/drivers/net/ethernet/mscc/ocelot_fdma.c
@@ -104,7 +104,7 @@ static int ocelot_fdma_wait_chan_safe(struct ocelot *ocelot, int chan)
 		safe = ocelot_fdma_readl(ocelot, MSCC_FDMA_CH_SAFE);
 		if (safe & BIT(chan))
 			return 0;
-	} while (time_after(jiffies, timeout));
+	} while (!time_after(jiffies, timeout));
 
 	return -ETIMEDOUT;
 }
-- 
2.36.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ