aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_bo.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-09-13 10:43:09 +0200
committerAlex Deucher <alexander.deucher@amd.com>2017-09-13 12:10:14 -0400
commit0d2bd2ae045d8dcb446a3d9a4cecefa70428573a (patch)
tree92c8bf8072a60eebf4c64ab9de04b7b447cb54d2 /drivers/gpu/drm/ttm/ttm_bo.c
parentdrm/amdgpu: fix and cleanup amdgpu_bo_create v2 (diff)
downloadlinux-dev-0d2bd2ae045d8dcb446a3d9a4cecefa70428573a.tar.xz
linux-dev-0d2bd2ae045d8dcb446a3d9a4cecefa70428573a.zip
drm/ttm: fix memory leak while individualizing BOs
We need to free the reservation object before we take the BO from the delayed delete list. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Monk Liu <monk.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index bee77d31895b..d79607a1187c 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -557,6 +557,8 @@ static int ttm_bo_cleanup_refs_and_unlock(struct ttm_buffer_object *bo,
}
ttm_bo_del_from_lru(bo);
+ if (!list_empty(&bo->ddestroy) && (bo->resv != &bo->ttm_resv))
+ reservation_object_fini(&bo->ttm_resv);
list_del_init(&bo->ddestroy);
kref_put(&bo->list_kref, ttm_bo_ref_bug);