diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2009-07-21 11:45:13 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-07-29 01:56:04 -0400 |
commit | 4677f15c60421d48566c48c3149474e64977f071 (patch) | |
tree | 674c1099d98e0a6d441b9cb53d7e872bdf7136a0 /drivers/gpu/drm | |
parent | 7a50f01a4ab89d5c05eb2cf62e206ac0bfc61d2c (diff) |
drm/ttm: Fix an oops and sync object leak.
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>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo_util.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index bdec583901eb..3e5d0c4ad85c 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c | |||
@@ -509,8 +509,8 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, | |||
509 | if (evict) { | 509 | if (evict) { |
510 | ret = ttm_bo_wait(bo, false, false, false); | 510 | ret = ttm_bo_wait(bo, false, false, false); |
511 | spin_unlock(&bo->lock); | 511 | spin_unlock(&bo->lock); |
512 | driver->sync_obj_unref(&bo->sync_obj); | 512 | if (tmp_obj) |
513 | 513 | driver->sync_obj_unref(&tmp_obj); | |
514 | if (ret) | 514 | if (ret) |
515 | return ret; | 515 | return ret; |
516 | 516 | ||
@@ -532,6 +532,8 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, | |||
532 | 532 | ||
533 | set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); | 533 | set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); |
534 | spin_unlock(&bo->lock); | 534 | spin_unlock(&bo->lock); |
535 | if (tmp_obj) | ||
536 | driver->sync_obj_unref(&tmp_obj); | ||
535 | 537 | ||
536 | ret = ttm_buffer_object_transfer(bo, &ghost_obj); | 538 | ret = ttm_buffer_object_transfer(bo, &ghost_obj); |
537 | if (ret) | 539 | if (ret) |