Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fixeup! drm/xe/xe_pagefault: Fix potential uninitialized fence usage in xe_pagefault_handle_vma
@ 2025-11-25 10:24 Nareshkumar Gollakoti
  2025-11-25 14:54 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Nareshkumar Gollakoti @ 2025-11-25 10:24 UTC (permalink / raw)
  To: intel-xe; +Cc: naresh.kumar.g

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);
+	}
 
 unlock_dma_resv:
 	xe_validation_ctx_fini(&ctx);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-11-26 13:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25 10:24 [PATCH] fixeup! drm/xe/xe_pagefault: Fix potential uninitialized fence usage in xe_pagefault_handle_vma Nareshkumar Gollakoti
2025-11-25 14:54 ` ✓ CI.KUnit: success for " Patchwork
2025-11-25 16:02 ` ✓ Xe.CI.BAT: " Patchwork
2025-11-25 18:42 ` ✗ Xe.CI.Full: failure " Patchwork
2025-11-26 11:55 ` [PATCH] " Yadav, Sanjay Kumar
2025-11-26 13:17   ` Kumar G, Naresh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox