drm/amdgpu: Fix dangling kfd_bo pointer for shared BOs
authorFelix Kuehling <Felix.Kuehling@amd.com>
Thu, 4 Nov 2021 19:11:04 +0000 (15:11 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Nov 2021 18:12:45 +0000 (14:12 -0400)
commit5702d052959f9d711698e2fc86a706db87e9d646
tree57ef454d2ad17ec82ad8e45374974dda76efb155
parentb8c20c74ab8c765b29fb253f6da4b0e59d9bdf3d
drm/amdgpu: Fix dangling kfd_bo pointer for shared BOs

If a kfd_bo was shared (e.g. a dmabuf export), the original kfd_bo may be
freed when the amdgpu_bo still lives on. Free the kfd_bo struct in the
release_notify callback then the amdgpu_bo is freed.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-By: Ramesh Errabolu <Ramesh.Errabolu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c