From: Christian König Date: Wed, 20 Oct 2021 17:19:46 +0000 (+0200) Subject: drm/ttm: fix memleak in ttm_transfered_destroy X-Git-Tag: accepted/tizen/unified/20230118.172025~6114^2~3^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0db55f9a1bafbe3dac750ea669de9134922389b5;p=platform%2Fkernel%2Flinux-rpi.git drm/ttm: fix memleak in ttm_transfered_destroy We need to cleanup the fences for ghost objects as well. Signed-off-by: Christian König Reported-by: Erhard F. Tested-by: Erhard F. Reviewed-by: Huang Rui Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214029 Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214447 CC: Link: https://patchwork.freedesktop.org/patch/msgid/20211020173211.2247-1-christian.koenig@amd.com --- diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 1c5ffe2..abf2d7a 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -190,6 +190,7 @@ static void ttm_transfered_destroy(struct ttm_buffer_object *bo) struct ttm_transfer_obj *fbo; fbo = container_of(bo, struct ttm_transfer_obj, base); + dma_resv_fini(&fbo->base.base._resv); ttm_bo_put(fbo->bo); kfree(fbo); }