Commit 9298e52f authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: fix user ptr race condition

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarmonk liu <monk.liu@amd.com>
parent 25f45e63
...@@ -37,6 +37,7 @@ void amdgpu_gem_object_free(struct drm_gem_object *gobj) ...@@ -37,6 +37,7 @@ void amdgpu_gem_object_free(struct drm_gem_object *gobj)
if (robj) { if (robj) {
if (robj->gem_base.import_attach) if (robj->gem_base.import_attach)
drm_prime_gem_destroy(&robj->gem_base, robj->tbo.sg); drm_prime_gem_destroy(&robj->gem_base, robj->tbo.sg);
amdgpu_mn_unregister(robj);
amdgpu_bo_unref(&robj); amdgpu_bo_unref(&robj);
} }
} }
......
...@@ -95,7 +95,6 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) ...@@ -95,7 +95,6 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
bo = container_of(tbo, struct amdgpu_bo, tbo); bo = container_of(tbo, struct amdgpu_bo, tbo);
amdgpu_update_memory_usage(bo->adev, &bo->tbo.mem, NULL); amdgpu_update_memory_usage(bo->adev, &bo->tbo.mem, NULL);
amdgpu_mn_unregister(bo);
mutex_lock(&bo->adev->gem.mutex); mutex_lock(&bo->adev->gem.mutex);
list_del_init(&bo->list); list_del_init(&bo->list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment