Skip to content

Commit bf61516

Browse files
mwajdeczjfvogel
authored andcommitted
drm/xe/sa: Always call drm_suballoc_manager_fini()
[ Upstream commit 9cd3f4e ] After successful call to drm_suballoc_manager_init() we should make sure to call drm_suballoc_manager_fini() as it may include some cleanup code even if we didn't start using it for real. As we can abort init() early due to kvzalloc() failure, we should either explicitly call drm_suballoc_manager_fini() or, even better, postpone drm_suballoc_manager_init() once we finish all other preparation steps, so we can rely on fini() that will do cleanup. Signed-off-by: Michal Wajdeczko <[email protected]> Cc: Matthew Brost <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 650c1769cfe9df648d212322d34f4c30b284d85c) Signed-off-by: Jack Vogel <[email protected]>
1 parent cc43391 commit bf61516

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/gpu/drm/xe/xe_sa.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32
5757
}
5858
sa_manager->bo = bo;
5959
sa_manager->is_iomem = bo->vmap.is_iomem;
60-
61-
drm_suballoc_manager_init(&sa_manager->base, managed_size, align);
6260
sa_manager->gpu_addr = xe_bo_ggtt_addr(bo);
6361

6462
if (bo->vmap.is_iomem) {
@@ -72,6 +70,7 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32
7270
memset(sa_manager->cpu_ptr, 0, bo->ttm.base.size);
7371
}
7472

73+
drm_suballoc_manager_init(&sa_manager->base, managed_size, align);
7574
ret = drmm_add_action_or_reset(&xe->drm, xe_sa_bo_manager_fini,
7675
sa_manager);
7776
if (ret)

0 commit comments

Comments
 (0)