> -----Original Message-----
> From: Intel-gfx <[email protected]> On Behalf Of
> Matthew Brost
> Sent: 26 November 2025 07:33
> To: Kumar G, Naresh <[email protected]>
> Cc: Vivi, Rodrigo <[email protected]>; [email protected]
> Subject: Re: [PATCH] fixeup! drm/xe/xe_pagefault: Fix potential uninitialized
> fence usage in xe_pagefault_handle_vma
>
> On Tue, Nov 25, 2025 at 08:18:37PM +0530, Kumar G, Naresh wrote:
> >
> >
> > On 25-11-2025 19:05, Rodrigo Vivi wrote:
> > > On Tue, Nov 25, 2025 at 03:48:42PM +0530, Nareshkumar Gollakoti
> wrote:
> > >
> > > Hi Nareshkumar,
> > >
> > > Thank you so much for the patch. I believe the change below is a
> > > good addition, but the patch itself is in a bad format.
> > >
> > > fixup in the commit subject is absolutely no no! This is a git
> > > indication that the patch should be squashed to the one introducing
> > > the error, but we are in a non-rebasing branch. So you need to
> > > provide a fix as a new patch and using the proper tags indicating
> > > which patch it is fixing and Cc'ing author and reviewer of the original
> > > patch.
> > >
> > Hi Rodrigo,
> > My appologies, will correct mentioned suggestions/feedback.but i have
> > pushed this patch to this mailing list by mistake and will correct and
> > route to the xe mailing list.
> >
> > ignore this patch
> >
> > Thanks,
> > Naresh
> > > In this case:
> > > Fixes: fb544b844508 ("drm/xe: Implement xe_pagefault_queue_work")
> > > Cc: Matthew Brost <[email protected]>
> > > Cc: Stuart Summers <[email protected]>
> > >
> > > > 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
> > >
> > > Furthermore, the message itself here is a bit strange. It is not
> > > necessarily true that it 'should' be initialized. In this case it
> > > looks more like a false positive of static analysis tools, but it
> > > would be good to have this protection just in case...
>
> Yes, I looked at code, I'm guessing this is a static analysis false positive.
Yeah, Naresh, lets drop patch then.
Tejas
>
> Matt
>
> > >
> > > So, some rephrasing here might be good.
> > >
> > > Please read the documentation on how to submit patches for the
> > > proper style and messages:
> > >
> > > https://www.kernel.org/doc/html/latest/process/submitting-patches.ht
> > > ml
> > >
> > > Thanks,
> > > Rodrigo.
> > >
> > >
> > > >
> > > > 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);
> > > > + }
> > > > unlock_dma_resv:
> > > > xe_validation_ctx_fini(&ctx);
> > > > --
> > > > 2.43.0
> > > >
> >