Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <dan.carpenter@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/aSW1UOgMCiQIaZG8@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dan Carpenter and committed by
Mark Brown
80339b38 a13744f6

+2 -2
+2 -2
sound/soc/sdca/sdca_function_device.c
··· 96 96 97 97 func_dev = sdca_dev_register(&slave->dev, 98 98 &sdca_data->function[i]); 99 - if (!func_dev) 100 - return -ENODEV; 99 + if (IS_ERR(func_dev)) 100 + return PTR_ERR(func_dev); 101 101 102 102 sdca_data->function[i].func_dev = func_dev; 103 103 }