Commit 7c4c3960 authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Dave Airlie

drm/ttm: fix ttm_bo_add_ttm(user) failure path

ttm_tt_destroy kfrees passed object, so we need to nullify
a reference to it.
Signed-off-by: default avatarMarcin Slusarz <>
Reviewed-by: default avatarThomas Hellstrom <>
Signed-off-by: default avatarDave Airlie <>
parent ba95c45a
......@@ -353,8 +353,10 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc)
ret = ttm_tt_set_user(bo->ttm, current,
bo->buffer_start, bo->num_pages);
if (unlikely(ret != 0))
if (unlikely(ret != 0)) {
bo->ttm = NULL;
printk(KERN_ERR TTM_PFX "Illegal buffer object type\n");
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