projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cdaeb57
)
ttm: Don't return the bo reserved on error path
author
Thomas Hellstrom
<
[email protected]
>
Mon, 21 Nov 2011 12:05:02 +0000
(13:05 +0100)
committer
Dave Airlie
<
[email protected]
>
Tue, 22 Nov 2011 20:06:21 +0000
(20:06 +0000)
An unlikely race could case a bo to be returned reserved on an error path.
Signed-off-by: Thomas Hellstrom <
[email protected]
>
Reviewed-by: Jerome Glisse <
[email protected]
>
Signed-off-by: Dave Airlie <
[email protected]
>
drivers/gpu/drm/ttm/ttm_bo.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/ttm/ttm_bo.c
b/drivers/gpu/drm/ttm/ttm_bo.c
index 617b64678fc62f24c70df6ae3fd7ba3bc7d6c9bf..0bb0f5f713e6cf9166a1b91eb19ab81b85206716 100644
(file)
--- 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;
}