]> www.infradead.org Git - users/dwmw2/linux.git/commit
ASoC: amd: Adjust error handling in case of absent codec device
authorAleksandr Mishin <amishin@t-argos.ru>
Wed, 3 Jul 2024 19:10:07 +0000 (22:10 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 4 Jul 2024 11:42:25 +0000 (12:42 +0100)
commit5080808c3339de2220c602ab7c7fa23dc6c1a5a3
tree1947c01be8cd85e3f282ea74285683d5c34c40ab
parent9f3ae72c5dbca9ba558c752f1ef969ed6908be01
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: 02527c3f2300 ("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>
sound/soc/amd/acp-es8336.c