aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c6
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)