mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Kazinsky <a.kazinsky@ideco.ru>
To: David Rhodes <david.rhodes@cirrus.com>
Cc: Alex Kazinsky <a.kazinsky@ideco.ru>,
	Richard Fitzgerald <rf@opensource.cirrus.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	"Vlad . Karpovich" <vkarpovi@opensource.cirrus.com>,
	linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: [PATCH] ASoC: cs35l45: Check spi_setup() return value
Date: Fri, 13 Nov 2026 15:09:05 +0400	[thread overview]
Message-ID: <20261113110907.4189173-1-a.kazinsky@ideco.ru> (raw)

The SPI probe ignores errors from spi_setup() after updating the maximum
bus frequency. If setup fails, initialization continues and accesses the
device without ensuring that the SPI configuration succeeded.

Check the return value and abort probe on failure, propagating the
original error.

Found by Linux Verification Center (linuxtesting.org) with SVACE static
analysis tool.

Fixes: 74b14e2850a3 ("ASoC: cs35l45: DSP Support")
Signed-off-by: Alex Kazinsky <a.kazinsky@ideco.ru>
---
 sound/soc/codecs/cs35l45-spi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs35l45-spi.c b/sound/soc/codecs/cs35l45-spi.c
index 76f46dc5ab2c..dcef36d31c45 100644
--- a/sound/soc/codecs/cs35l45-spi.c
+++ b/sound/soc/codecs/cs35l45-spi.c
@@ -24,7 +24,9 @@ static int cs35l45_spi_probe(struct spi_device *spi)
 		return -ENOMEM;
 
 	spi->max_speed_hz = CS35L45_SPI_MAX_FREQ;
-	spi_setup(spi);
+	ret = spi_setup(spi);
+	if (ret)
+		return ret;
 
 	spi_set_drvdata(spi, cs35l45);
 	cs35l45->regmap = devm_regmap_init_spi(spi, &cs35l45_spi_regmap);
-- 
2.56.0



                 reply	other threads:[~2026-11-13 11:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261113110907.4189173-1-a.kazinsky@ideco.ru \
    --to=a.kazinsky@ideco.ru \
    --cc=broonie@kernel.org \
    --cc=david.rhodes@cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=rf@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    --cc=vkarpovi@opensource.cirrus.com \
    /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

all inboxes | Powered by JetHome®