]> Git Repo - linux.git/commitdiff
drm/ttm:fix memory leak due to individualize
authorMonk Liu <[email protected]>
Mon, 23 Oct 2017 02:30:57 +0000 (10:30 +0800)
committerAlex Deucher <[email protected]>
Tue, 31 Oct 2017 22:24:58 +0000 (18:24 -0400)
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 <[email protected]>
Reviewed-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/ttm/ttm_bo.c

index d79607a1187c866c0e016c89311711c5f1941d6a..379ec41d2c6926ca8ade6b933b670e043edf195c 100644 (file)
@@ -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;
                }
This page took 0.06496 seconds and 4 git commands to generate.