diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2021-09-04 13:37:32 +0200 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2021-10-15 09:49:55 -0500 |
commit | 0374a4ea7269645c46c3eb288526ea072fa19e79 (patch) | |
tree | 3a2b5187a419353b513e701592375eb1a729d6a8 /tools/testing/selftests/bpf/prog_tests/recursion.c | |
parent | d6a33c5bdc84cc37d38e74afe0449c1192eea920 (diff) |
remoteproc: Fix a memory leak in an error handling path in 'rproc_handle_vdev()'
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: e0d072782c73 ("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
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/recursion.c')
0 files changed, 0 insertions, 0 deletions