Skip to content

Commit d844fd0

Browse files
committed
Merge tag 'amd-drm-fixes-6.6-2023-10-19' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.6-2023-10-19: amdgpu: - Fix possible NULL pointer dereference - Avoid possible BUG_ON in GPUVM updates Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 5872080 + 316baf0 commit d844fd0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,10 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach)
403403
continue;
404404
}
405405

406-
r = amdgpu_vm_clear_freed(adev, vm, NULL);
406+
/* Reserve fences for two SDMA page table updates */
407+
r = dma_resv_reserve_fences(resv, 2);
408+
if (!r)
409+
r = amdgpu_vm_clear_freed(adev, vm, NULL);
407410
if (!r)
408411
r = amdgpu_vm_handle_moved(adev, vm);
409412

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)