summary refs log tree commit diff
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorMatthew Auld <matthew.auld@intel.com>2022-04-13 09:21:33 +0100
committerChristian König <christian.koenig@amd.com>2022-04-13 10:53:09 +0200
commit7be2bb8c2ff3f769c49f5a527e7ea992b81e9ca1 (patch)
tree695de3f42db3b9f4f09ce91bebdd047d36c1a9b3 /drivers/gpu/drm/ttm
parent62c6f4f9bb08a8b18fc6e12d865284991ec3776a (diff)
downloadlinux-7be2bb8c2ff3f769c49f5a527e7ea992b81e9ca1.tar.gz
drm/ttm: fixup ttm_bo_add_move_fence v2
It looks like we still need to call dma_fence_put() on the man->move,
otherwise we just end up leaking it, leading to fireworks later.

v2(Daniel):
  - Simplify the function tail

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5689
Fixes: 8bb31587820a ("drm/ttm: remove bo->moving")
Cc: Christian König <christian.koenig@amd.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220413082133.272445-1-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 015a94f766de..75d308ec173d 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -740,11 +740,8 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
 	dma_resv_add_fence(bo->base.resv, fence, DMA_RESV_USAGE_KERNEL);
 
 	ret = dma_resv_reserve_fences(bo->base.resv, 1);
-	if (unlikely(ret)) {
-		dma_fence_put(fence);
-		return ret;
-	}
-	return 0;
+	dma_fence_put(fence);
+	return ret;
 }
 
 /*