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]
Date:   Sat, 13 May 2023 05:26:53 -0700
From:   Sukrut Bellary <sukrut.bellary@...ux.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Sukrut Bellary <sukrut.bellary@...ux.com>,
        linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] spi:pic32: Fix missing error code 'ret' in the failure path

smatch warning -
drivers/spi/spi-pic32.c:634 pic32_spi_dma_prep() warn: missing error code 'ret'

Currently in case of pic32_spi_dma_config() failure, SUCCESS is returned.
Capture and return the error code in the failure path.

This is based on static analysis only. Compilation tested.

Signed-off-by: Sukrut Bellary <sukrut.bellary@...ux.com>
---
 drivers/spi/spi-pic32.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c
index f2af5e653f3d..2b1b1eea9c64 100644
--- a/drivers/spi/spi-pic32.c
+++ b/drivers/spi/spi-pic32.c
@@ -630,7 +630,8 @@ static int pic32_spi_dma_prep(struct pic32_spi *pic32s, struct device *dev)
 		goto out_err;
 	}
 
-	if (pic32_spi_dma_config(pic32s, DMA_SLAVE_BUSWIDTH_1_BYTE))
+	ret = pic32_spi_dma_config(pic32s, DMA_SLAVE_BUSWIDTH_1_BYTE);
+	if (ret)
 		goto out_err;
 
 	/* DMA chnls allocated and prepared */
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ