diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-11-21 13:05:02 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-11-22 20:06:21 +0000 |
commit | 26cc40a83384178bfaefbcfb4786591498f3e190 (patch) | |
tree | 6b82f08110f349b458c001d73f50e6808e96026c /drivers | |
parent | cdaeb578aca9e017deb0f55f1af8a94a4d63efb3 (diff) |
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: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 617b64678fc6..0bb0f5f713e6 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -574,10 +574,16 @@ retry: return ret; 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, no_wait_reserve, false, 0); - if (unlikely(ret != 0) || list_empty(&bo->ddestroy)) { + if (unlikely(ret != 0)) { spin_unlock(&glob->lru_lock); return ret; } |