mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
drm/xe/sa: Drop redundant NULL assignments
The sa_manager is drmm_kzalloc'ed so all members are already zero. And in case of kvzalloc() failure we are not returning pointer to the sa_manager at all, so no point in resetting .bo member. 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-3-michal.wajdeczko@intel.com
This commit is contained in:
@@ -44,8 +44,6 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32
|
||||
if (!sa_manager)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
sa_manager->bo = NULL;
|
||||
|
||||
bo = xe_managed_bo_create_pin_map(xe, tile, size,
|
||||
XE_BO_FLAG_VRAM_IF_DGFX(tile) |
|
||||
XE_BO_FLAG_GGTT |
|
||||
@@ -61,10 +59,8 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32
|
||||
|
||||
if (bo->vmap.is_iomem) {
|
||||
sa_manager->cpu_ptr = kvzalloc(managed_size, GFP_KERNEL);
|
||||
if (!sa_manager->cpu_ptr) {
|
||||
sa_manager->bo = NULL;
|
||||
if (!sa_manager->cpu_ptr)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
} else {
|
||||
sa_manager->cpu_ptr = bo->vmap.vaddr;
|
||||
memset(sa_manager->cpu_ptr, 0, bo->ttm.base.size);
|
||||
|
||||
Reference in New Issue
Block a user