Skip to content

Commit 5514392

Browse files
fxkamdgregkh
authored andcommitted
drm/amdgpu: Fix possible null pointer dereference
[ Upstream commit 51b79f3 ] 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 <Felix.Kuehling@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 85985bf commit 5514392

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
@@ -1094,7 +1094,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
10941094
struct drm_gem_object *gobj = dma_buf->priv;
10951095
struct amdgpu_bo *abo = gem_to_amdgpu_bo(gobj);
10961096

1097-
if (abo->tbo.resource->mem_type == TTM_PL_VRAM)
1097+
if (abo->tbo.resource &&
1098+
abo->tbo.resource->mem_type == TTM_PL_VRAM)
10981099
bo = gem_to_amdgpu_bo(gobj);
10991100
}
11001101
mem = bo->tbo.resource;

0 commit comments

Comments
 (0)