]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ASoC: qcom: Adjust issues in case of DT error in asoc_qcom_lpass_cpu_platform_probe()
authorAleksandr Mishin <amishin@t-argos.ru>
Wed, 5 Jun 2024 10:49:53 +0000 (13:49 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 26 Jun 2024 17:35:51 +0000 (18:35 +0100)
commitf9f7f29f64454bb20896c7d918c3abc3a1aa487b
tree4a89d2c5b16134c7f51ff7503d15400cd52686b1
parent06462d6f3fb3c445b5abac7b134d9fe9e361113f
ASoC: qcom: Adjust issues in case of DT error in asoc_qcom_lpass_cpu_platform_probe()

If IORESOURCE_MEM "lpass-rxtx-cdc-dma-lpm" or "lpass-va-cdc-dma-lpm"
resources is not provided in Device Tree due to any error,
platform_get_resource_byname() will return NULL which is later
dereferenced. According to sound/qcom,lpass-cpu.yaml, these resources
are provided, but DT can be broken due to any error. In such cases driver
must be able to protect itself, since the DT is external data for the
driver.
Adjust this issues by adding NULL return check.

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

Fixes: b138706225c9 ("ASoC: qcom: Add regmap config support for codec dma driver")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://patch.msgid.link/20240605104953.12072-1-amishin@t-argos.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/lpass-cpu.c