Skip to contentSkip to conversation

drm/ttm: fix memory leak while individualizing BOs

PATCH In review Christian König 2 participants 2 messages Sep 13, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: fix memory leak while individualizing BOs

From: Christian König <[email protected]>

We need to free the reservation object before we take the BO from the delayed delete list.

---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/ttm/ttm_bo.c +2 -0
index bee77d3..d79607a 100644
@@ -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);
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1505292454-22259-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

Reviewed-by
#2 lore raw

verified work,

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]>
Sent: Wednesday, September 13, 2017 4:47:34 PM
To: [email protected]; [email protected]
Subject: [PATCH] drm/ttm: fix memory leak while individualizing BOs

From: Christian König <[email protected]>

We need to free the reservation object before we take the BO from the delayed delete list.

---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/ttm/ttm_bo.c +2 -0
index bee77d3..d79607a 100644
@@ -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);
 

--
2.7.4

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx