Skip to content

Commit a590f03

Browse files
author
Thomas Hellström
committed
drm/ttm: Don't leak a resource on swapout move error
If moving the bo to system for swapout failed, we were leaking a resource. Fix. Fixes: bfa3357 ("drm/ttm: allocate resource object instead of embedding it v2") Cc: Christian König <christian.koenig@amd.com> Cc: "Christian König" <ckoenig.leichtzumerken@gmail.com> Cc: dri-devel@lists.freedesktop.org Cc: <stable@vger.kernel.org> # v5.14+ Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230626091450.14757-5-thomas.hellstrom@linux.intel.com
1 parent e8188c4 commit a590f03

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
11671167
ret = ttm_bo_handle_move_mem(bo, evict_mem, true, &ctx, &hop);
11681168
if (unlikely(ret != 0)) {
11691169
WARN(ret == -EMULTIHOP, "Unexpected multihop in swaput - likely driver bug.\n");
1170+
ttm_resource_free(bo, &evict_mem);
11701171
goto out;
11711172
}
11721173
}

0 commit comments

Comments
 (0)