Re: [PATCH] drm/amdkfd: Fix memory leak in kfd_mem_dmamap_userptr()

2022-10-19 Thread Felix Kuehling
On 2022-10-17 21:27, Rafael Mendonca wrote: 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

[PATCH] drm/amdkfd: Fix memory leak in kfd_mem_dmamap_userptr()

2022-10-17 Thread Rafael Mendonca
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: 2