The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2] spi: spi-mux: Fix coverity issue, unchecked return value
@ 2025-03-16  5:46 Sergio Perez Gonzalez
  2025-03-17 19:42 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Sergio Perez Gonzalez @ 2025-03-16  5:46 UTC (permalink / raw)
  To: broonie, skhan; +Cc: linux-spi, linux-kernel, Sergio Perez Gonzalez

The return value of spi_setup() is not captured within
spi_mux_select() and it is assumed to be always success.

CID: 1638374

Signed-off-by: Sergio Perez Gonzalez <sperezglz@gmail.com>
---
v2: Return spi_setup() directly instead of using ret variable.

---
 drivers/spi/spi-mux.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/spi/spi-mux.c b/drivers/spi/spi-mux.c
index c02c4204442f..0eb35c4e3987 100644
--- a/drivers/spi/spi-mux.c
+++ b/drivers/spi/spi-mux.c
@@ -68,9 +68,7 @@ static int spi_mux_select(struct spi_device *spi)
 
 	priv->current_cs = spi_get_chipselect(spi, 0);
 
-	spi_setup(priv->spi);
-
-	return 0;
+	return spi_setup(priv->spi);
 }
 
 static int spi_mux_setup(struct spi_device *spi)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-17 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-16  5:46 [PATCH v2] spi: spi-mux: Fix coverity issue, unchecked return value Sergio Perez Gonzalez
2025-03-17 19:42 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox