Skip to content

Commit 8c8c062

Browse files
AhzodChristianKoenigAMD
authored andcommitted
drm/ttm: fix leaking fences via ttm_buffer_object_transfer
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. Bug: https://gitlab.freedesktop.org/drm/amd/issues/958 Fixes: 1e053b1 ("drm/ttm: use gem reservation object") Reviewed-by: Christian König <[email protected]> Signed-off-by: Ahzo <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/355089/
1 parent eb9d8dd commit 8c8c062

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/ttm/ttm_bo_util.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
515515
fbo->base.base.resv = &fbo->base.base._resv;
516516

517517
dma_resv_init(&fbo->base.base._resv);
518+
fbo->base.base.dev = NULL;
518519
ret = dma_resv_trylock(&fbo->base.base._resv);
519520
WARN_ON(!ret);
520521

0 commit comments

Comments
 (0)