Skip to content

Commit f360e2b

Browse files
Shang XiaoJingandersson
authored andcommitted
remoteproc: qcom: q6v5: Fix potential null-ptr-deref in q6v5_wcss_init_mmio()
q6v5_wcss_init_mmio() will call platform_get_resource_byname() that may fail and return NULL. devm_ioremap() will use res->start as input, which may causes null-ptr-deref. Check the ret value of platform_get_resource_byname() to avoid the null-ptr-deref. Fixes: 0af65b9 ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404") Signed-off-by: Shang XiaoJing <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e01ce67 commit f360e2b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/remoteproc/qcom_q6v5_wcss.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,9 @@ static int q6v5_wcss_init_mmio(struct q6v5_wcss *wcss,
827827
int ret;
828828

829829
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qdsp6");
830+
if (!res)
831+
return -EINVAL;
832+
830833
wcss->reg_base = devm_ioremap(&pdev->dev, res->start,
831834
resource_size(res));
832835
if (!wcss->reg_base)

0 commit comments

Comments
 (0)