On 11/13/26 00:37, Erhan Bilgili wrote:
> If a fallback wait is interrupted, USERQ_WAIT leaves the unwrap loop
> without releasing the reference taken by dma_fence_unwrap_first().
> That reference is normally dropped by dma_fence_chain_walk().
> 
> Drop iter.chain before returning the error.
> 
> Fixes: 15e30a6e4792 ("drm/amdgpu: Add wait IOCTL timeline syncobj support")
> Signed-off-by: Erhan Bilgili <[email protected]>

Good catch, but we should probably fix dma_fence_unwrap() instead and add a 
cleanup.

I will take care of that.

Regards,
Christian.

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> index dd976a50e053..e7b63c227421 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> @@ -796,6 +796,7 @@ amdgpu_userq_wait_return_fence_info(struct drm_device 
> *dev, struct drm_file *fil
>                       r = amdgpu_userq_wait_add_fence(wait_info, fences,
>                                                       &num_fences, f);
>                       if (r) {
> +                             dma_fence_put(iter.chain);
>                               dma_fence_put(fence);
>                               goto free_fences;
>                       }

Reply via email to