]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drm/amdgpu: fix another missing fence reference in the CS code
[mirror_ubuntu-kernels.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_cs.c
index 8516c814bc9b5e2a497d6c4c0af16b3a57c6f57c..47763ac0d14a579f6cf091480b346ee928b92188 100644 (file)
@@ -1254,9 +1254,12 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
                        continue;
 
                fence = &p->jobs[i]->base.s_fence->scheduled;
+               dma_fence_get(fence);
                r = drm_sched_job_add_dependency(&leader->base, fence);
-               if (r)
+               if (r) {
+                       dma_fence_put(fence);
                        goto error_cleanup;
+               }
        }
 
        if (p->gang_size > 1) {