forked from Minki/linux
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:
parent
25f45e6338
commit
9298e52f8b
@ -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)
|
|||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user