Commit a5d5634c authored by Shuicheng Lin's avatar Shuicheng Lin Committed by Matthew Brost
Browse files

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: adda4e85 ("drm/xe: Enforce correct user fence signaling order using")
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarShuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260219233516.2938172-6-shuicheng.lin@intel.com
parent f939bdd9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -206,8 +206,10 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,
			if (XE_IOCTL_DBG(xe, IS_ERR(sync->ufence)))
				return PTR_ERR(sync->ufence);
			sync->ufence_chain_fence = dma_fence_chain_alloc();
			if (!sync->ufence_chain_fence)
				return -ENOMEM;
			if (!sync->ufence_chain_fence) {
				err = -ENOMEM;
				goto free_sync;
			}
			sync->ufence_syncobj = ufence_syncobj;
		}