drm/xe: Fix an IS_ERR() vs NULL bug in xe_tile_alloc_vram()

commit 6c9e64e83b upstream.

The xe_vram_region_alloc() function returns NULL on error.  It never
returns error pointers.  Update the error checking to match.

Fixes: 4b0a5f5ce7 ("drm/xe: Unify the initialization of VRAM regions")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/5449065e-9758-4711-b706-78771c0753c4@sabinyo.mountain
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dan Carpenter 2025-07-18 16:23:05 -05:00 committed by Greg Kroah-Hartman
parent b5b378d254
commit 29319ff775

View File

@ -116,8 +116,8 @@ int xe_tile_alloc_vram(struct xe_tile *tile)
return 0;
vram = xe_vram_region_alloc(xe, tile->id, XE_PL_VRAM0 + tile->id);
if (IS_ERR(vram))
return PTR_ERR(vram);
if (!vram)
return -ENOMEM;
tile->mem.vram = vram;
return 0;