Skip to content

Commit 51b79f3

Browse files
fxkamdalexdeucher
authored andcommitted
drm/amdgpu: Fix possible null pointer dereference
abo->tbo.resource may be NULL in amdgpu_vm_bo_update. Fixes: 1802537 ("drm/ttm: stop allocating dummy resources during BO creation") Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 5872080 commit 51b79f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
10901090
struct drm_gem_object *gobj = dma_buf->priv;
10911091
struct amdgpu_bo *abo = gem_to_amdgpu_bo(gobj);
10921092

1093-
if (abo->tbo.resource->mem_type == TTM_PL_VRAM)
1093+
if (abo->tbo.resource &&
1094+
abo->tbo.resource->mem_type == TTM_PL_VRAM)
10941095
bo = gem_to_amdgpu_bo(gobj);
10951096
}
10961097
mem = bo->tbo.resource;

0 commit comments

Comments
 (0)