aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorMonk Liu2017-10-23 10:30:57 +0800
committerAlex Deucher2017-10-31 18:24:58 -0400
commitbbb4d8d9ee81714b98c25df39a1ed90fa075e90a (patch)
tree4d92a6c42b003fa69a25bce486b07f982816034f /drivers/gpu/drm/ttm
parenta695e43712242c354748e9bae5d137d4337a7694 (diff)
drm/ttm:fix memory leak due to individualize
after individualize we need manually call reservation_object_fini() if all fences on resv signaled during test, otherwise kmemory leak Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index d79607a1187c..379ec41d2c69 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -457,8 +457,11 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo)
if (reservation_object_test_signaled_rcu(&bo->ttm_resv, true)) {
ttm_bo_del_from_lru(bo);
spin_unlock(&glob->lru_lock);
- if (bo->resv != &bo->ttm_resv)
+ if (bo->resv != &bo->ttm_resv) {
reservation_object_unlock(&bo->ttm_resv);
+ reservation_object_fini(&bo->ttm_resv);
+ }
+
ttm_bo_cleanup_memtype_use(bo);
return;
}