drm/amdgpu: fix user ptr race condition

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: monk liu <monk.liu@amd.com>
This commit is contained in:
Christian König 2015-06-03 21:31:20 +02:00 committed by Alex Deucher
parent 25f45e6338
commit 9298e52f8b
2 changed files with 1 additions and 1 deletions

View File

@ -37,6 +37,7 @@ void amdgpu_gem_object_free(struct drm_gem_object *gobj)
if (robj) {
if (robj->gem_base.import_attach)
drm_prime_gem_destroy(&robj->gem_base, robj->tbo.sg);
amdgpu_mn_unregister(robj);
amdgpu_bo_unref(&robj);
}
}

View File

@ -95,7 +95,6 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
bo = container_of(tbo, struct amdgpu_bo, tbo);
amdgpu_update_memory_usage(bo->adev, &bo->tbo.mem, NULL);
amdgpu_mn_unregister(bo);
mutex_lock(&bo->adev->gem.mutex);
list_del_init(&bo->list);