linux-stable/drivers/remoteproc
Christophe JAILLET 5061e10234 remoteproc: Fix a memory leak in an error handling path in 'rproc_handle_vdev()'
[ Upstream commit 0374a4ea72 ]

If 'copy_dma_range_map() fails, the memory allocated for 'rvdev' will leak.
Move the 'copy_dma_range_map()' call after the device registration so
that 'rproc_rvdev_release()' can be called to free some resources.

Also, branch to the error handling path if 'copy_dma_range_map()' instead
of a direct return to avoid some other leaks.

Fixes: e0d072782c ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jim Quinlan <james.quinlan@broadcom.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/e6d0dad6620da4fdf847faa903f79b735d35f262.1630755377.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18 14:04:23 +01:00
..
da8xx_remoteproc.c
imx_rproc.c
ingenic_rproc.c
Kconfig
keystone_remoteproc.c
Makefile
mtk_common.h
mtk_scp.c remoteproc/mediatek: Fix kernel test robot warning 2021-03-07 12:34:15 +01:00
mtk_scp_ipi.c
omap_remoteproc.c
omap_remoteproc.h
qcom_common.c
qcom_common.h
qcom_pil_info.c remoteproc: qcom: pil_info: avoid 64-bit division 2021-04-14 08:42:05 +02:00
qcom_pil_info.h
qcom_q6v5.c
qcom_q6v5.h
qcom_q6v5_adsp.c
qcom_q6v5_mss.c remoteproc: qcom_q6v5_mss: Validate p_filesz in ELF loader 2021-05-19 10:13:01 +02:00
qcom_q6v5_pas.c
qcom_q6v5_wcss.c
qcom_sysmon.c
qcom_wcnss.c
qcom_wcnss.h
qcom_wcnss_iris.c
remoteproc_cdev.c remoteproc: core: Fix cdev remove and rproc del 2021-07-20 16:05:48 +02:00
remoteproc_core.c remoteproc: Fix a memory leak in an error handling path in 'rproc_handle_vdev()' 2021-11-18 14:04:23 +01:00
remoteproc_coredump.c
remoteproc_debugfs.c
remoteproc_elf_helpers.h
remoteproc_elf_loader.c
remoteproc_internal.h
remoteproc_sysfs.c
remoteproc_virtio.c
st_remoteproc.c
st_slim_rproc.c
stm32_rproc.c
ti_k3_dsp_remoteproc.c
ti_k3_r5_remoteproc.c remoteproc: k3-r5: Fix an error message 2021-07-20 16:05:50 +02:00
ti_sci_proc.h
wkup_m3_rproc.c