diff options
| author | Felix Kuehling <[email protected]> | 2023-10-17 20:51:03 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-10-19 22:56:50 +0000 |
| commit | 51b79f33817544e3b4df838d86e8e8e4388ff684 (patch) | |
| tree | 97a41f527bc8392b031e5e7dd4cec47d287640e7 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
| parent | Linux 6.6-rc6 (diff) | |
| download | kernel-51b79f33817544e3b4df838d86e8e8e4388ff684.tar.gz kernel-51b79f33817544e3b4df838d86e8e8e4388ff684.zip | |
drm/amdgpu: Fix possible null pointer dereference
abo->tbo.resource may be NULL in amdgpu_vm_bo_update.
Fixes: 180253782038 ("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]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index f5daadcec865..82f25996ff5e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1090,7 +1090,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va, struct drm_gem_object *gobj = dma_buf->priv; struct amdgpu_bo *abo = gem_to_amdgpu_bo(gobj); - if (abo->tbo.resource->mem_type == TTM_PL_VRAM) + if (abo->tbo.resource && + abo->tbo.resource->mem_type == TTM_PL_VRAM) bo = gem_to_amdgpu_bo(gobj); } mem = bo->tbo.resource; |
