Skip to content

Commit 41cc108

Browse files
drm/amdgpu: fix missing dma_fence_put in error path
When the fence can't be added we need to drop the reference. Suggested-by: Bert Karwatzki <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Luben Tuikov <[email protected]>
1 parent ed21f6c commit 41cc108

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,10 @@ int amdgpu_sync_push_to_job(struct amdgpu_sync *sync, struct amdgpu_job *job)
391391

392392
dma_fence_get(f);
393393
r = drm_sched_job_add_dependency(&job->base, f);
394-
if (r)
394+
if (r) {
395+
dma_fence_put(f);
395396
return r;
397+
}
396398
}
397399
return 0;
398400
}

0 commit comments

Comments
 (0)