From: Dan Carpenter <dan.carpenter@linaro.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>,
Maciej Strozek <mstrozek@opensource.cirrus.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
Vinod Koul <vkoul@kernel.org>,
linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH next] ASoC: SDCA: Fix NULL vs IS_ERR() bug in sdca_dev_register_functions()
Date: Tue, 25 Nov 2025 16:55:28 +0300 [thread overview]
Message-ID: <aSW1UOgMCiQIaZG8@stanley.mountain> (raw)
The sdca_dev_register() function never returns NULL, it returns error
pointers on error. Fix the error checking to match.
Fixes: 4496d1c65bad ("ASoC: SDCA: add function devices")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
sound/soc/sdca/sdca_function_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sdca/sdca_function_device.c b/sound/soc/sdca/sdca_function_device.c
index 91c49d7389db..c6cc880a150e 100644
--- a/sound/soc/sdca/sdca_function_device.c
+++ b/sound/soc/sdca/sdca_function_device.c
@@ -96,8 +96,8 @@ int sdca_dev_register_functions(struct sdw_slave *slave)
func_dev = sdca_dev_register(&slave->dev,
&sdca_data->function[i]);
- if (!func_dev)
- return -ENODEV;
+ if (IS_ERR(func_dev))
+ return PTR_ERR(func_dev);
sdca_data->function[i].func_dev = func_dev;
}
--
2.51.0
next reply other threads:[~2025-11-25 13:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 13:55 Dan Carpenter [this message]
2025-11-25 14:03 ` [PATCH next] ASoC: SDCA: Fix NULL vs IS_ERR() bug in sdca_dev_register_functions() Charles Keepax
2025-11-25 20:04 ` 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=aSW1UOgMCiQIaZG8@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mstrozek@opensource.cirrus.com \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=tiwai@suse.com \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.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