Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH next] ASoC: SDCA: Fix NULL vs IS_ERR() bug in sdca_dev_register_functions()
@ 2025-11-25 13:55 Dan Carpenter
  2025-11-25 14:03 ` Charles Keepax
  2025-11-25 20:04 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-11-25 13:55 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: Charles Keepax, Maciej Strozek, Bard Liao, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Peter Ujfalusi,
	Vinod Koul, linux-sound, patches, linux-kernel, kernel-janitors

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


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

end of thread, other threads:[~2025-11-25 20:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25 13:55 [PATCH next] ASoC: SDCA: Fix NULL vs IS_ERR() bug in sdca_dev_register_functions() Dan Carpenter
2025-11-25 14:03 ` Charles Keepax
2025-11-25 20:04 ` Mark Brown

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