From: Dan Carpenter Date: Tue, 25 Nov 2025 13:55:28 +0000 (+0300) Subject: ASoC: SDCA: Fix NULL vs IS_ERR() bug in sdca_dev_register_functions() X-Git-Tag: v6.19-rc1~156^2~3^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80339b3823bb76d383c82186b55ac836fed3f586;p=thirdparty%2Fkernel%2Flinux.git 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") Signed-off-by: Dan Carpenter Reviewed-by: Charles Keepax Link: https://patch.msgid.link/aSW1UOgMCiQIaZG8@stanley.mountain Signed-off-by: Mark Brown --- diff --git a/sound/soc/sdca/sdca_function_device.c b/sound/soc/sdca/sdca_function_device.c index 91c49d7389db0..c6cc880a150eb 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; }