Skip to contentSkip to conversation

ASoC: SDCA: Fix NULL vs IS_ERR() bug in sdca_dev_register_functions()

PATCH In review Dan Carpenter 3 participants 3 messages Nov 25, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: SDCA: Fix NULL vs IS_ERR() bug in sdca_dev_register_functions()

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")
---
 sound/soc/sdca/sdca_function_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/sdca/sdca_function_device.c +2 -2
index 91c49d7389db..c6cc880a150e 100644
@@ -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;
 	}
Signature · 1 line
2.51.0
maintainer
#2 lore raw
In reply to Dan Carpenter
Quoted 4 lines · Dan Carpenter

The sdca_dev_register() function never returns NULL, it returns error pointers on error. Fix the error checking to match.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SDCA: Fix NULL vs IS_ERR() bug in sdca_dev_register_functions()

      commit: 80339b3823bb76d383c82186b55ac836fed3f586

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark