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>] [day] [month] [year] [list]
Message-Id: <20250313214545.7444-1-qasdev00@gmail.com>
Date: Thu, 13 Mar 2025 21:45:45 +0000
From: Qasim Ijaz <qasdev00@...il.com>
To: broonie@...nel.org,
	looong.bin@...il.com
Cc: linux-spi@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] spi: sophgo: fix incorrect type for ret in sg2044_spifmc_write()

The sg2044_spifmc_write() function uses 'ret' of unsigned type 
size_t to capture return values from sg2044_spifmc_wait_xfer_size() 
and sg2044_spifmc_wait_int(). Since these functions may return 
negative error codes, using an unsigned type prevents proper 
error detection, as size_t cannot represent negative values. 

Change 'ret' to type int so that negative values are handled correctly.

Fixes: de16c322eefb ("spi: sophgo: add SG2044 SPI NOR controller driver")
Signed-off-by: Qasim Ijaz <qasdev00@...il.com>
---
 drivers/spi/spi-sg2044-nor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-sg2044-nor.c b/drivers/spi/spi-sg2044-nor.c
index 454153a63b42..baa4cf677663 100644
--- a/drivers/spi/spi-sg2044-nor.c
+++ b/drivers/spi/spi-sg2044-nor.c
@@ -216,7 +216,7 @@ static ssize_t sg2044_spifmc_write(struct sg2044_spifmc *spifmc,
 	size_t xfer_size;
 	const u8 *dout = op->data.buf.out;
 	int i, offset;
-	size_t ret;
+	int ret;
 	u32 reg;
 
 	reg = sg2044_spifmc_init_reg(spifmc);
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ