summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_sync.c
diff options
context:
space:
mode:
authorHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>2024-08-20 14:32:28 +0530
committerNirmoy Das <nirmoy.das@intel.com>2024-08-27 10:32:57 +0200
commit11b7309dbe9fa98d9b8d18cd51db4f385c37ae30 (patch)
tree9599c0c1aeeeeaf1b0938ad904fe4d1f5e449731 /drivers/gpu/drm/xe/xe_sync.c
parent9c57bc08652a7c8e0e355c52c023fddc090fe9bb (diff)
downloadlwn-11b7309dbe9fa98d9b8d18cd51db4f385c37ae30.tar.gz
lwn-11b7309dbe9fa98d9b8d18cd51db4f385c37ae30.zip
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 <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>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_sync.c')
-rw-r--r--drivers/gpu/drm/xe/xe_sync.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c
index ca826aeb41ea..a0675f57a398 100644
--- a/drivers/gpu/drm/xe/xe_sync.c
+++ b/drivers/gpu/drm/xe/xe_sync.c
@@ -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;
}