Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbb4d8d9 authored by Monk Liu's avatar Monk Liu Committed by Alex Deucher
Browse files

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: default avatarMonk Liu <Monk.Liu@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a695e437
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;
		}