linux/drivers/remoteproc
Zhang Changzhong 1ba196a73c remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio()
[ Upstream commit c3d4e5b12672bbdf63f4cc933e3169bc6bbec8da ]

platform_get_resource() may fail and in this case a NULL dereference
will occur.

Fix it to use devm_platform_ioremap_resource() instead of calling
platform_get_resource() and devm_ioremap().

This is detected by Coccinelle semantic patch.

@@
expression pdev, res, n, t, e, e1, e2;
@@

res = \(platform_get_resource\|platform_get_resource_byname\)(pdev, t,
n);
+ if (!res)
+   return -EINVAL;
... when != res == NULL
e = devm_ioremap(e1, res->start, e2);

Fixes: dc160e4491 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/r/1607392460-20516-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-30 11:51:24 +01:00
..
Kconfig
Makefile
da8xx_remoteproc.c
imx_rproc.c
keystone_remoteproc.c
omap_remoteproc.c
omap_remoteproc.h
qcom_common.c
qcom_common.h
qcom_q6v5.c remoteproc: qcom: q6v5: Update running state before requesting stop 2020-08-21 13:05:29 +02:00
qcom_q6v5.h
qcom_q6v5_adsp.c remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio() 2020-12-30 11:51:24 +01:00
qcom_q6v5_mss.c remoteproc: q6v5-mss: fix error handling in q6v5_pds_enable 2020-12-30 11:51:23 +01:00
qcom_q6v5_pas.c
qcom_q6v5_wcss.c
qcom_sysmon.c
qcom_wcnss.c
qcom_wcnss.h
qcom_wcnss_iris.c
remoteproc_core.c remoteproc: Fix IDR initialisation in rproc_alloc() 2020-06-24 17:50:09 +02:00
remoteproc_debugfs.c
remoteproc_elf_loader.c
remoteproc_internal.h
remoteproc_sysfs.c
remoteproc_virtio.c remoteproc: Fall back to using parent memory pool if no dedicated available 2020-06-17 16:40:33 +02:00
st_remoteproc.c
st_slim_rproc.c
stm32_rproc.c
wkup_m3_rproc.c