diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2009-08-03 12:39:06 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-08-04 13:41:05 +1000 |
commit | fee280d3fd9bc5247bef9f4ab35a4693bfffdcfd (patch) | |
tree | 8105956fc8da63d8e5bba0453841ea84e00e5d5b /drivers/gpu/drm | |
parent | c9b7fb54f0a51e587fa09be3a85666b43d36a850 (diff) | |
download | talos-obmc-linux-fee280d3fd9bc5247bef9f4ab35a4693bfffdcfd.tar.gz talos-obmc-linux-fee280d3fd9bc5247bef9f4ab35a4693bfffdcfd.zip |
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')
-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, driver->sync_obj_unref(&sync_obj); driver->sync_obj_unref(&tmp_obj); spin_lock(&bo->lock); + } else { + spin_unlock(&bo->lock); + driver->sync_obj_unref(&sync_obj); + spin_lock(&bo->lock); } } return 0; |