Skip to content

Commit

Permalink
drm/xe: Remove extra dma_fence_put on xe_sync_entry_add_deps failure
Browse files Browse the repository at this point in the history
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 <himal.prasad.ghimiray@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Acked-by: Nirmoy Das <nirmoy.das@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240820090230.3258128-1-himal.prasad.ghimiray@intel.com
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
  • Loading branch information
Himal Prasad Ghimiray authored and Nirmoy Das committed Aug 27, 2024
1 parent 9c57bc0 commit 11b7309
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions drivers/gpu/drm/xe/xe_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,9 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,

int xe_sync_entry_add_deps(struct xe_sync_entry *sync, struct xe_sched_job *job)
{
int err;

if (sync->fence) {
err = drm_sched_job_add_dependency(&job->drm,
dma_fence_get(sync->fence));
if (err) {
dma_fence_put(sync->fence);
return err;
}
}
if (sync->fence)
return drm_sched_job_add_dependency(&job->drm,
dma_fence_get(sync->fence));

return 0;
}
Expand Down

0 comments on commit 11b7309

Please sign in to comment.