Skip to contentSkip to conversation

drm/amdgpu/userq: Add a comment to avoid confusion

PATCH New Sunil Khatri 1 participant 1 message Mar 20

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/userq: Add a comment to avoid confusion

Add a comment to explain clearyl why in both success and failure condition we need to put a reference to dma_fence to avoid confusion.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +3 -1
index f93da45cfa7e..18390d37a7e0 100644
@@ -779,6 +779,7 @@ amdgpu_userq_wait_return_fence_info(struct drm_file *filp,
 			}
 		}
 
+		/* Drop the reference taken from drm_syncobj_find_fence */
 		dma_fence_put(fence);
 	}
 
@@ -795,10 +796,11 @@ amdgpu_userq_wait_return_fence_info(struct drm_file *filp,
 
 		r = amdgpu_userq_wait_add_fence(wait_info, fences,
 						&num_fences, fence);
+
+		/* Drop the reference taken from drm_syncobj_find_fence */
 		dma_fence_put(fence);
 		if (r)
 			goto free_fences;
-
 	}
 
 	/* Lock all the GEM objects */
Signature · 1 line
2.34.1