kernel_optimize_test/drivers/remoteproc
Zhang Changzhong 9d909187e5 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:53:48 +01:00
..
da8xx_remoteproc.c
imx_rproc.c
ingenic_rproc.c
Kconfig remoteproc: k3-r5: Add a remoteproc driver for R5F subsystem 2020-10-13 18:34:38 -05:00
keystone_remoteproc.c
Makefile remoteproc: k3-r5: Add a remoteproc driver for R5F subsystem 2020-10-13 18:34:38 -05:00
mtk_common.h remoteproc/mediatek: change MT8192 CFG register base 2020-12-30 11:53:47 +01:00
mtk_scp_ipi.c remoteproc/mediatek: Add support for mt8192 SCP 2020-09-25 23:37:42 -05:00
mtk_scp.c remoteproc/mtk_scp: surround DT device IDs with CONFIG_OF 2020-12-30 11:53:48 +01:00
omap_remoteproc.c
omap_remoteproc.h
qcom_common.c
qcom_common.h
qcom_pil_info.c
qcom_pil_info.h
qcom_q6v5_adsp.c remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio() 2020-12-30 11:53:48 +01:00
qcom_q6v5_mss.c remoteproc: q6v5-mss: fix error handling in q6v5_pds_enable 2020-12-30 11:53:48 +01:00
qcom_q6v5_pas.c remoteproc: qcom: pas: fix error handling in adsp_pds_enable 2020-12-30 11:53:48 +01:00
qcom_q6v5_wcss.c
qcom_q6v5.c
qcom_q6v5.h
qcom_sysmon.c
qcom_wcnss_iris.c
qcom_wcnss.c
qcom_wcnss.h
remoteproc_cdev.c
remoteproc_core.c dma-mapping: split <linux/dma-mapping.h> 2020-10-06 07:07:03 +02:00
remoteproc_coredump.c remoteproc: Change default dump configuration to "disabled" 2020-10-13 19:20:54 -05:00
remoteproc_debugfs.c remoteproc: Change default dump configuration to "disabled" 2020-10-13 19:20:54 -05:00
remoteproc_elf_helpers.h
remoteproc_elf_loader.c
remoteproc_internal.h
remoteproc_sysfs.c remoteproc: Add recovery configuration to the sysfs interface 2020-10-13 19:22:51 -05:00
remoteproc_virtio.c dma-mapping: split <linux/dma-mapping.h> 2020-10-06 07:07:03 +02:00
st_remoteproc.c
st_slim_rproc.c
stm32_rproc.c
ti_k3_dsp_remoteproc.c remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories() 2020-12-30 11:53:48 +01:00
ti_k3_r5_remoteproc.c remoteproc: k3-r5: Add loading support for on-chip SRAM regions 2020-10-13 18:34:40 -05:00
ti_sci_proc.h
wkup_m3_rproc.c