Skip to content

Commit

Permalink
drm/ttm: Fix an oops and sync object leak.
Browse files Browse the repository at this point in the history
The code was potentially dereferencig a NULL sync object pointer.
At the same time a sync object reference was potentially leaked.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Jul 29, 2009
1 parent 7a50f01 commit 4677f15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/ttm/ttm_bo_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
if (evict) {
ret = ttm_bo_wait(bo, false, false, false);
spin_unlock(&bo->lock);
driver->sync_obj_unref(&bo->sync_obj);

if (tmp_obj)
driver->sync_obj_unref(&tmp_obj);
if (ret)
return ret;

Expand All @@ -532,6 +532,8 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,

set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
spin_unlock(&bo->lock);
if (tmp_obj)
driver->sync_obj_unref(&tmp_obj);

ret = ttm_buffer_object_transfer(bo, &ghost_obj);
if (ret)
Expand Down

0 comments on commit 4677f15

Please sign in to comment.