linux-stable/drivers/gpu
Rafael Mendonca c6dc4c9ba0 drm/amdkfd: Fix memory leak in kfd_mem_dmamap_userptr()
[ Upstream commit 90bfee142a ]

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: 264fb4d332 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-04 00:00:31 +09:00
..
drm drm/amdkfd: Fix memory leak in kfd_mem_dmamap_userptr() 2022-11-04 00:00:31 +09:00
host1x gpu: host1x: Use the bitmap API to allocate bitmaps 2022-07-08 17:38:34 +02:00
ipu-v3
trace
vga
Makefile