drm/amdkfd: fix a potential ttm->sg memory leak
authorLang Yu <lang.yu@amd.com>
Wed, 29 Sep 2021 06:54:39 +0000 (14:54 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Oct 2021 14:53:45 +0000 (10:53 -0400)
commitb072ef1215aca33186e3a10109e872e528a9e516
treee7fc9e9946f6dd4c2a58adef2f6da18ee37cdbc5
parent7ab0965079bbc0e39fe0e1df4dcdf931c9d25372
drm/amdkfd: fix a potential ttm->sg memory leak

Memory is allocated for ttm->sg by kmalloc in kfd_mem_dmamap_userptr,
but isn't freed by kfree in kfd_mem_dmaunmap_userptr. Free it!

Fixes: 264fb4d332f5 ("drm/amdgpu: Add multi-GPU DMA mapping helpers")

Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c