]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm: fix leaking fences via ttm_buffer_object_transfer
authorAhzo <Ahzo@tutanota.com>
Tue, 25 Feb 2020 18:56:14 +0000 (13:56 -0500)
committerChristian König <christian.koenig@amd.com>
Wed, 26 Feb 2020 13:24:21 +0000 (14:24 +0100)
commitd8a4f3b95e22a9f0dde6c3e4b28b262d1e3c63a1
tree38274e5e04451447d686bcf9bb35dd48b4360e21
parentb2bfdfcd99a3bd5c08526a21eb9ba63281ddd3f8
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: 6c61d808e070 ("drm/ttm: use gem reservation object")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Ahzo <Ahzo@tutanota.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/355089/
drivers/gpu/drm/ttm/ttm_bo_util.c