From: Matthew Brost <matthew.brost@intel.com>
To: Nareshkumar Gollakoti <naresh.kumar.g@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] fixeup! drm/xe/xe_pagefault: Fix potential uninitialized fence usage in xe_pagefault_handle_vma
Date: Tue, 25 Nov 2025 18:01:57 -0800 [thread overview]
Message-ID: <aSZflcvbWFwFUYuI@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20251125101841.2325554-2-naresh.kumar.g@intel.com>
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 <naresh.kumar.g@intel.com>
> ---
> 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
>
next prev parent reply other threads:[~2025-11-26 2:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 10:18 [PATCH] fixeup! drm/xe/xe_pagefault: Fix potential uninitialized fence usage in xe_pagefault_handle_vma Nareshkumar Gollakoti
2025-11-25 12:36 ` ✓ i915.CI.BAT: success for " Patchwork
2025-11-25 13:35 ` [PATCH] " Rodrigo Vivi
2025-11-25 14:48 ` Kumar G, Naresh
2025-11-26 2:03 ` Matthew Brost
2025-11-26 4:04 ` Upadhyay, Tejas
2025-11-25 22:22 ` ✗ i915.CI.Full: failure for " Patchwork
2025-11-26 2:01 ` Matthew Brost [this message]
2025-11-26 2:07 ` [PATCH] " Matthew Brost
2025-11-26 4:02 ` Upadhyay, Tejas
2025-11-26 15:50 ` Andi Shyti
2025-11-26 16:07 ` Kumar G, Naresh
-- strict thread matches above, loose matches on Subject: below --
2025-11-25 10:24 Nareshkumar Gollakoti
2025-11-26 11:55 ` Yadav, Sanjay Kumar
2025-11-26 13:17 ` Kumar G, Naresh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aSZflcvbWFwFUYuI@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=naresh.kumar.g@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.