drm/xe/sa: Always call drm_suballoc_manager_fini()
[ Upstream commit 9cd3f4efc870463f17f6c29114c61fb6bfcaa291 ] 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 <michal.wajdeczko@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241220194205.995-2-michal.wajdeczko@intel.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1cc3716373
commit
650c1769cf
@@ -57,8 +57,6 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32
|
||||
}
|
||||
sa_manager->bo = bo;
|
||||
sa_manager->is_iomem = bo->vmap.is_iomem;
|
||||
|
||||
drm_suballoc_manager_init(&sa_manager->base, managed_size, align);
|
||||
sa_manager->gpu_addr = xe_bo_ggtt_addr(bo);
|
||||
|
||||
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
|
||||
memset(sa_manager->cpu_ptr, 0, bo->ttm.base.size);
|
||||
}
|
||||
|
||||
drm_suballoc_manager_init(&sa_manager->base, managed_size, align);
|
||||
ret = drmm_add_action_or_reset(&xe->drm, xe_sa_bo_manager_fini,
|
||||
sa_manager);
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user