diff options
| author | Rafael Mendonca <rafaelmendsr@gmail.com> | 2022-10-17 22:27:50 -0300 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2022-10-24 14:34:27 -0400 |
| commit | 7b5a4d7b9e2952a15c8d2b2391dfacd7ce841a1a (patch) | |
| tree | de593280b53e96e93f382781fea5397093abf6ea /lib/mpi/mpi-inline.h | |
| parent | 20293269d81779a0d0c0865f5877b240c3335c97 (diff) | |
drm/amdkfd: Fix memory leak in kfd_mem_dmamap_userptr()
If the number of pages from the userptr BO differs from the SG BO then the
allocated memory for the SG table doesn't get freed before returning
-EINVAL, which may lead to a memory leak in some error paths. Fix this by
checking the number of pages before allocating memory for the SG table.
Fixes: 264fb4d332f5 ("drm/amdgpu: Add multi-GPU DMA mapping helpers")
Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'lib/mpi/mpi-inline.h')
0 files changed, 0 insertions, 0 deletions
