Skip to content

Commit 64db767

Browse files
prliangpubalexdeucher
authored andcommitted
drm/amdgpu: fix userq resource double freed
As the userq resource was already freed at the drm_release early phase, it should avoid freeing userq resource again at the later kms postclose callback. Signed-off-by: Prike Liang <Prike.Liang@amd.com> Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 96a86dc commit 64db767

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,10 +1502,11 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
15021502
amdgpu_bo_unreserve(pd);
15031503
}
15041504

1505-
fpriv->evf_mgr.fd_closing = true;
1506-
amdgpu_userq_mgr_fini(&fpriv->userq_mgr);
1507-
amdgpu_eviction_fence_destroy(&fpriv->evf_mgr);
1508-
1505+
if (!fpriv->evf_mgr.fd_closing) {
1506+
fpriv->evf_mgr.fd_closing = true;
1507+
amdgpu_userq_mgr_fini(&fpriv->userq_mgr);
1508+
amdgpu_eviction_fence_destroy(&fpriv->evf_mgr);
1509+
}
15091510
amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr);
15101511
amdgpu_vm_fini(adev, &fpriv->vm);
15111512

0 commit comments

Comments
 (0)