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 <[email protected]> Cc: "Christian König" <[email protected]> Cc: [email protected] Cc: <[email protected]> # v5.14+ Signed-off-by: Thomas Hellström <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Reviewed-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e8188c4 commit a590f03

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)