Skip to content

Commit 49abfa8

Browse files
Tvrtko Ursulinalexdeucher
authored andcommitted
drm/amdgpu/userq: Fix reference leak in amdgpu_userq_wait_ioctl
Drop reference to syncobj and timeline fence when aborting the ioctl due output array being too small. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Fixes: a292fde ("drm/amdgpu: Implement userqueue signal/wait IOCTL") Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 68951e9) Cc: <stable@vger.kernel.org> # v6.16+
1 parent 6de23f8 commit 49abfa8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
876876
dma_fence_unwrap_for_each(f, &iter, fence) {
877877
if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
878878
r = -EINVAL;
879+
dma_fence_put(fence);
879880
goto free_fences;
880881
}
881882

@@ -900,6 +901,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
900901

901902
if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
902903
r = -EINVAL;
904+
dma_fence_put(fence);
903905
goto free_fences;
904906
}
905907

0 commit comments

Comments
 (0)