Skip to content

Commit 0879c3f

Browse files
ShuichengLinrodrigovivi
authored andcommitted
drm/xe/sync: Fix user fence leak on alloc failure
When dma_fence_chain_alloc() fails, properly release the user fence reference to prevent a memory leak. Fixes: 0995c2f ("drm/xe: Enforce correct user fence signaling order using") Cc: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260219233516.2938172-6-shuicheng.lin@intel.com (cherry picked from commit a5d5634) Cc: stable@vger.kernel.org Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent 1bfd757 commit 0879c3f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/gpu/drm/xe/xe_sync.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,10 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,
206206
if (XE_IOCTL_DBG(xe, IS_ERR(sync->ufence)))
207207
return PTR_ERR(sync->ufence);
208208
sync->ufence_chain_fence = dma_fence_chain_alloc();
209-
if (!sync->ufence_chain_fence)
210-
return -ENOMEM;
209+
if (!sync->ufence_chain_fence) {
210+
err = -ENOMEM;
211+
goto free_sync;
212+
}
211213
sync->ufence_syncobj = ufence_syncobj;
212214
}
213215

0 commit comments

Comments
 (0)