linux/drivers/remoteproc
Aleksandr Mishin 84beb77384 remoteproc: imx_rproc: Skip over memory region when node value is NULL
[ Upstream commit 2fa26ca8b7 ]

In imx_rproc_addr_init() "nph = of_count_phandle_with_args()" just counts
number of phandles. But phandles may be empty. So of_parse_phandle() in
the parsing loop (0 < a < nph) may return NULL which is later dereferenced.
Adjust this issue by adding NULL-return check.

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

Fixes: a0ff4aa6f0 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240606075204.12354-1-amishin@t-argos.ru
[Fixed title to fit within the prescribed 70-75 charcters]
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-19 05:33:44 +02:00
..
da8xx_remoteproc.c
imx_rproc.c remoteproc: imx_rproc: Skip over memory region when node value is NULL 2024-08-19 05:33:44 +02:00
Kconfig
keystone_remoteproc.c
Makefile
omap_remoteproc.c
omap_remoteproc.h
qcom_common.c
qcom_common.h
qcom_q6v5_adsp.c
qcom_q6v5_mss.c remoteproc: qcom_q6v5_mss: Use a carveout to authenticate modem headers 2023-03-11 16:43:52 +01:00
qcom_q6v5_pas.c remoteproc: qcom_q6v5_pas: Fix missing of_node_put() in adsp_alloc_memory_region() 2023-01-18 11:41:31 +01:00
qcom_q6v5_wcss.c
qcom_q6v5.c
qcom_q6v5.h
qcom_sysmon.c remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev() 2023-01-18 11:41:31 +01:00
qcom_wcnss_iris.c
qcom_wcnss.c remoteproc: qcom: wcnss: Fix handling of IRQs 2022-08-25 11:18:02 +02:00
qcom_wcnss.h
remoteproc_core.c
remoteproc_debugfs.c
remoteproc_elf_loader.c
remoteproc_internal.h
remoteproc_sysfs.c
remoteproc_virtio.c
st_remoteproc.c remoteproc: st: Call of_node_put() on iteration error 2023-05-17 11:36:01 +02:00
st_slim_rproc.c
stm32_rproc.c remoteproc: stm32: Call of_node_put() on iteration error 2023-05-17 11:36:01 +02:00
wkup_m3_rproc.c