Skip to content

Commit

Permalink
drm/ttm: Fix a sync object leak.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Aug 4, 2009
1 parent c9b7fb5 commit fee280d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fee280d

Please sign in to comment.