On Tue, Nov 25, 2025 at 03:48:42PM +0530, Nareshkumar Gollakoti wrote:
> The variable "fence" should be initialized to NULL,
> and any usage of fence should be guarded
> by a check to ensure it is not NULL
> 
> Signed-off-by: Nareshkumar Gollakoti <[email protected]>
> ---
>  drivers/gpu/drm/xe/xe_pagefault.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pagefault.c 
> b/drivers/gpu/drm/xe/xe_pagefault.c
> index afb06598b6e1..401f1835939b 100644
> --- a/drivers/gpu/drm/xe/xe_pagefault.c
> +++ b/drivers/gpu/drm/xe/xe_pagefault.c
> @@ -70,7 +70,7 @@ static int xe_pagefault_handle_vma(struct xe_gt *gt, struct 
> xe_vma *vma,
>       struct xe_tile *tile = gt_to_tile(gt);
>       struct xe_validation_ctx ctx;
>       struct drm_exec exec;
> -     struct dma_fence *fence;
> +     struct dma_fence *fence = NULL;
>       int err, needs_vram;
>  
>       lockdep_assert_held_write(&vm->lock);
> @@ -122,8 +122,10 @@ static int xe_pagefault_handle_vma(struct xe_gt *gt, 
> struct xe_vma *vma,
>               }
>       }
>  
> -     dma_fence_wait(fence, false);
> -     dma_fence_put(fence);
> +     if (fence) {
> +             dma_fence_wait(fence, false);
> +             dma_fence_put(fence);
> +     }

Maybe I'm blind, but I don't see the problem in the existing code. How
did this get reported as an issue which you are trying to fix here?

Also I think Rodrigo mentioned this fixup! are not convention in DRM,
rather 'Fixes' tags.

Matt

>  
>  unlock_dma_resv:
>       xe_validation_ctx_fini(&ctx);
> -- 
> 2.43.0
> 

Reply via email to