From: Christian König Date: Mon, 19 Dec 2022 10:47:18 +0000 (+0100) Subject: drm/amdgpu: grab extra fence reference for drm_sched_job_add_dependency X-Git-Tag: v6.6.7~3824^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1c4a8b217213c1924eabf4f28385bbee9cc50c1;p=platform%2Fkernel%2Flinux-starfive.git drm/amdgpu: grab extra fence reference for drm_sched_job_add_dependency That function consumes the reference. Reviewed-by: Luben Tuikov Reported-by: Borislav Petkov (AMD) Tested-by: Borislav Petkov (AMD) Signed-off-by: Christian König Fixes: aab9cf7b6954 ("drm/amdgpu: use scheduler dependencies for VM updates") Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c index 59cf642..535cd65 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c @@ -238,8 +238,10 @@ static int amdgpu_vm_sdma_update(struct amdgpu_vm_update_params *p, /* Wait for PD/PT moves to be completed */ dma_resv_iter_begin(&cursor, bo->tbo.base.resv, DMA_RESV_USAGE_KERNEL); dma_resv_for_each_fence_unlocked(&cursor, fence) { + dma_fence_get(fence); r = drm_sched_job_add_dependency(&p->job->base, fence); if (r) { + dma_fence_put(fence); dma_resv_iter_end(&cursor); return r; }