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: <20250725171701.839927-1-colin.i.king@gmail.com>
Date: Fri, 25 Jul 2025 18:17:01 +0100
From: Colin Ian King <colin.i.king@...il.com>
To: Sunny Luo <sunny.luo@...ogic.com>,
	Xianwei Zhao <xianwei.zhao@...ogic.com>,
	Mark Brown <broonie@...nel.org>,
	linux-amlogic@...ts.infradead.org,
	linux-spi@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH][next] spi: SPISG: Fix less than zero comparison on a u32 variable

The check for ns < 0 is always false because variable ns is a u32 which
is not a signed type. Fix this by making ns a s32 type.

Fixes: cef9991e04ae ("spi: Add Amlogic SPISG driver")
Signed-off-by: Colin Ian King <colin.i.king@...il.com>
---
 drivers/spi/spi-amlogic-spisg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spisg.c
index 48a5325b4db7..2ab8bdf2a676 100644
--- a/drivers/spi/spi-amlogic-spisg.c
+++ b/drivers/spi/spi-amlogic-spisg.c
@@ -163,7 +163,7 @@ struct spisg_device {
 
 static int spi_delay_to_sclk(u32 slck_speed_hz, struct spi_delay *delay)
 {
-	u32 ns;
+	s32 ns;
 
 	if (!delay)
 		return 0;
-- 
2.50.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ