Patch "ASoC: qcom: Adjust issues in case of DT error in asoc_qcom_lpass_cpu_platform_probe()" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ASoC: qcom: Adjust issues in case of DT error in asoc_qcom_lpass_cpu_platform_probe()

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asoc-qcom-adjust-issues-in-case-of-dt-error-in-asoc_.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0d275a1be6ee8683d26ede210a525f5aea11fbb9
Author: Aleksandr Mishin <amishin@xxxxxxxxxx>
Date:   Wed Jun 5 13:49:53 2024 +0300

    ASoC: qcom: Adjust issues in case of DT error in asoc_qcom_lpass_cpu_platform_probe()
    
    [ Upstream commit f9f7f29f64454bb20896c7d918c3abc3a1aa487b ]
    
    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@xxxxxxxxxx>
    Link: https://patch.msgid.link/20240605104953.12072-1-amishin@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 39571fed40019..73b42d9ee2447 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -1170,9 +1170,13 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
 		}
 
 		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-rxtx-cdc-dma-lpm");
+		if (!res)
+			return -EINVAL;
 		drvdata->rxtx_cdc_dma_lpm_buf = res->start;
 
 		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-va-cdc-dma-lpm");
+		if (!res)
+			return -EINVAL;
 		drvdata->va_cdc_dma_lpm_buf = res->start;
 	}
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux