Skip to content

Commit 29319ff

Browse files
Dan Carpentergregkh
authored andcommitted
drm/xe: Fix an IS_ERR() vs NULL bug in xe_tile_alloc_vram()
commit 6c9e64e83b22405622d1f47417cdb0d20d49ca35 upstream. The xe_vram_region_alloc() function returns NULL on error. It never returns error pointers. Update the error checking to match. Fixes: 4b0a5f5ce784 ("drm/xe: Unify the initialization of VRAM regions") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Rodrigo Vivi <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b5b378d commit 29319ff

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/xe/xe_tile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ int xe_tile_alloc_vram(struct xe_tile *tile)
116116
return 0;
117117

118118
vram = xe_vram_region_alloc(xe, tile->id, XE_PL_VRAM0 + tile->id);
119-
if (IS_ERR(vram))
120-
return PTR_ERR(vram);
119+
if (!vram)
120+
return -ENOMEM;
121121
tile->mem.vram = vram;
122122

123123
return 0;

0 commit comments

Comments
 (0)