On Mon, Feb 23, 2026 at 7:41 AM Tvrtko Ursulin
<[email protected]> wrote:
>
> If we gate the fence destruction with a check telling us whether there are
> valid pointers in there we can eliminate the need for dual, basically
> identical, exit paths.
>
> Signed-off-by: Tvrtko Ursulin <[email protected]>

Patches 1-3 are:
Reviewed-by: Alex Deucher <[email protected]>
and applied.  Still reviewing the rest.

Alex



> ---
>  .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c   | 28 ++++---------------
>  1 file changed, 5 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> index d972dc46f5a8..67911e6c552f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> @@ -971,32 +971,14 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, 
> void *data,
>                         r = -EFAULT;
>                         goto free_fences;
>                 }
> -
> -               kfree(fences);
> -               kfree(fence_info);
>         }
>
> -       drm_exec_fini(&exec);
> -       for (i = 0; i < num_read_bo_handles; i++)
> -               drm_gem_object_put(gobj_read[i]);
> -       kfree(gobj_read);
> -
> -       for (i = 0; i < num_write_bo_handles; i++)
> -               drm_gem_object_put(gobj_write[i]);
> -       kfree(gobj_write);
> -
> -       kfree(timeline_points);
> -       kfree(timeline_handles);
> -       kfree(syncobj_handles);
> -       kfree(bo_handles_write);
> -       kfree(bo_handles_read);
> -
> -       return 0;
> -
>  free_fences:
> -       while (num_fences-- > 0)
> -               dma_fence_put(fences[num_fences]);
> -       kfree(fences);
> +       if (fences) {
> +               while (num_fences-- > 0)
> +                       dma_fence_put(fences[num_fences]);
> +               kfree(fences);
> +       }
>  free_fence_info:
>         kfree(fence_info);
>  exec_fini:
> --
> 2.52.0
>

Reply via email to