diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2009-08-03 06:39:06 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-08-03 23:41:05 -0400 |
commit | fee280d3fd9bc5247bef9f4ab35a4693bfffdcfd (patch) | |
tree | 8105956fc8da63d8e5bba0453841ea84e00e5d5b /drivers/gpu/drm/ttm | |
parent | c9b7fb54f0a51e587fa09be3a85666b43d36a850 (diff) |
drm/ttm: Fix a sync object leak.
If there are multiple simultaneous waiters for the same buffer object,
a temporary reference to its sync object may be leaked.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 6538d4236989..aa82d5370c38 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -1575,6 +1575,10 @@ int ttm_bo_wait(struct ttm_buffer_object *bo, | |||
1575 | driver->sync_obj_unref(&sync_obj); | 1575 | driver->sync_obj_unref(&sync_obj); |
1576 | driver->sync_obj_unref(&tmp_obj); | 1576 | driver->sync_obj_unref(&tmp_obj); |
1577 | spin_lock(&bo->lock); | 1577 | spin_lock(&bo->lock); |
1578 | } else { | ||
1579 | spin_unlock(&bo->lock); | ||
1580 | driver->sync_obj_unref(&sync_obj); | ||
1581 | spin_lock(&bo->lock); | ||
1578 | } | 1582 | } |
1579 | } | 1583 | } |
1580 | return 0; | 1584 | return 0; |