linux/sound/soc/amd
Aleksandr Mishin 5080808c33
ASoC: amd: Adjust error handling in case of absent codec device
acpi_get_first_physical_node() can return NULL in several cases (no such
device, ACPI table error, reference count drop to 0, etc).
Existing check just emit error message, but doesn't perform return.
Then this NULL pointer is passed to devm_acpi_dev_add_driver_gpios()
where it is dereferenced.

Adjust this error handling by adding error code return.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 02527c3f23 ("ASoC: amd: add Machine driver for Jadeite platform")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://patch.msgid.link/20240703191007.8524-1-amishin@t-argos.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-04 12:42:25 +01:00
..
acp ASoC: amd: acp: add pcm constraints for buffer size and period size 2024-06-21 13:18:09 +01:00
include
ps ASoC: amd: add missing MODULE_DESCRIPTION() macros 2024-06-13 10:20:06 +01:00
raven ASoC: amd: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:13 +09:00
renoir ASoC: amd: add missing MODULE_DESCRIPTION() macros 2024-06-13 10:20:06 +01:00
rpl ASoC: amd: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:13 +09:00
vangogh ASoC: amd: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:13 +09:00
yc ASoC: amd: add missing MODULE_DESCRIPTION() macros 2024-06-13 10:20:06 +01:00
acp-config.c ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
acp-da7219-max98357a.c ASoC: amd: acp-da7219-max98357a: Constify regulator_ops 2024-04-15 10:17:20 +09:00
acp-es8336.c ASoC: amd: Adjust error handling in case of absent codec device 2024-07-04 12:42:25 +01:00
acp-pcm-dma.c ASoC: amd: convert not to use asoc_xxx() 2023-09-25 14:16:17 +02:00
acp-rt5645.c ASoC: amd: convert not to use asoc_xxx() 2023-09-25 14:16:17 +02:00
acp.h ASoC: amd: add I2S MICSP instance support 2022-07-05 13:00:44 +01:00
acp3x-rt5682-max9836.c ASoC: amd: Use snd_soc_substream_to_rtd() for accessing private_data 2024-05-06 23:59:50 +09:00
Kconfig ASoC: amd: fix for soundwire build dependencies for legacy stack 2024-04-09 18:14:18 +01:00
mach-config.h ASoC: amd: acp: add code for scanning acp pdm controller 2023-10-25 17:21:48 +01:00
Makefile ASoC: amd: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:13 +09:00