FAILED: patch "[PATCH] drm/ttm: fix leaking fences via ttm_buffer_object_transfer" failed to apply to 5.4-stable tree
Subsystems (4)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 8c8c06207bcfc5a7e5918fc0a0f7f7b9a2e196d6 Mon Sep 17 00:00:00 2001
From: Ahzo <[email protected]>
Date: Tue, 25 Feb 2020 13:56:14 -0500
Subject: [PATCH] drm/ttm: fix leaking fences via ttm_buffer_object_transfer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Set the drm_device to NULL, so that the newly created buffer object doesn't appear to use the embedded gem object.
This is necessary, because otherwise no corresponding dma_resv_fini for the dma_resv_init is called, resulting in a memory leak.
The dma_resv_fini in ttm_bo_release_list is only called if the embedded gem object is not used, which is determined by checking if the drm_device is NULL.
drivers/gpu/drm/ttm/ttm_bo_util.c +1 -0
@@ -515,6 +515,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, fbo->base.base.resv = &fbo->base.base._resv;dma_resv_init (&fbo->base.base._resv); + fbo->base.base.dev =NULL ; ret =dma_resv_trylock (&fbo->base.base._resv);WARN_ON (!ret);