提交 26cc40a8 编写于 作者: T Thomas Hellstrom 提交者: Dave Airlie

ttm: Don't return the bo reserved on error path

An unlikely race could case a bo to be returned reserved on an error path.
Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: NJerome Glisse <jglisse@redhat.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 cdaeb578
...@@ -574,10 +574,16 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo, ...@@ -574,10 +574,16 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
return ret; return ret;
spin_lock(&glob->lru_lock); spin_lock(&glob->lru_lock);
if (unlikely(list_empty(&bo->ddestroy))) {
spin_unlock(&glob->lru_lock);
return 0;
}
ret = ttm_bo_reserve_locked(bo, interruptible, ret = ttm_bo_reserve_locked(bo, interruptible,
no_wait_reserve, false, 0); no_wait_reserve, false, 0);
if (unlikely(ret != 0) || list_empty(&bo->ddestroy)) { if (unlikely(ret != 0)) {
spin_unlock(&glob->lru_lock); spin_unlock(&glob->lru_lock);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册