From: Sergio Perez Gonzalez <sperezglz@gmail.com>
To: broonie@kernel.org, skhan@linuxfoundation.org
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Sergio Perez Gonzalez <sperezglz@gmail.com>
Subject: [PATCH v2] spi: spi-mux: Fix coverity issue, unchecked return value
Date: Sat, 15 Mar 2025 23:46:06 -0600 [thread overview]
Message-ID: <20250316054651.13242-1-sperezglz@gmail.com> (raw)
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
next reply other threads:[~2025-03-16 5:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-16 5:46 Sergio Perez Gonzalez [this message]
2025-03-17 19:42 ` [PATCH v2] spi: spi-mux: Fix coverity issue, unchecked return value Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250316054651.13242-1-sperezglz@gmail.com \
--to=sperezglz@gmail.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox