As mentioned earlier, you should send these patches to the linux
maintainers.

We don't even build this file.

On Wed, Jun 15, 2022 at 11:29:31AM +0800, Xiaohui Zhang wrote:
> amdgpu_amdkfd_gpuvm_free_memory_of_gpu drop dmabuf reference increased in
> amdgpu_gem_prime_export.
> amdgpu_bo_destroy drop dmabuf reference increased in
> amdgpu_gem_prime_import.
> 
> So remove this extra dma_buf_put to avoid double free.
> 
> Signed-off-by: Xiaohui Zhang <[email protected]>
> ---
>  sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c 
> b/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 34bd9712d..00c311082 100644
> --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -644,12 +644,6 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct 
> kgd_mem *mem,
>       if (IS_ERR(gobj))
>               return PTR_ERR(gobj);
>  
> -     /* Import takes an extra reference on the dmabuf. Drop it now to
> -      * avoid leaking it. We only need the one reference in
> -      * kgd_mem->dmabuf.
> -      */
> -     dma_buf_put(mem->dmabuf);
> -
>       *bo = gem_to_amdgpu_bo(gobj);
>       (*bo)->flags |= AMDGPU_GEM_CREATE_PREEMPTIBLE;
>       (*bo)->parent = amdgpu_bo_ref(mem->bo);
> -- 
> 2.17.1
> 
> 

Reply via email to