Skip to content

Commit 11b7309

Browse files
hghimiranirmoy
authored andcommitted
drm/xe: Remove extra dma_fence_put on xe_sync_entry_add_deps failure
drm_sched_job_add_dependency() drops references even in case of error, no need for caller to call dma_fence_put. Signed-off-by: Himal Prasad Ghimiray <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Reviewed-by: Ashutosh Dixit <[email protected]> Acked-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Nirmoy Das <[email protected]>
1 parent 9c57bc0 commit 11b7309

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

drivers/gpu/drm/xe/xe_sync.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,9 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,
206206

207207
int xe_sync_entry_add_deps(struct xe_sync_entry *sync, struct xe_sched_job *job)
208208
{
209-
int err;
210-
211-
if (sync->fence) {
212-
err = drm_sched_job_add_dependency(&job->drm,
213-
dma_fence_get(sync->fence));
214-
if (err) {
215-
dma_fence_put(sync->fence);
216-
return err;
217-
}
218-
}
209+
if (sync->fence)
210+
return drm_sched_job_add_dependency(&job->drm,
211+
dma_fence_get(sync->fence));
219212

220213
return 0;
221214
}

0 commit comments

Comments
 (0)