Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Fix uninitialized return value from xe_validation_guard()
@ 2025-10-27 13:12 Thomas Hellström
  2025-10-27 16:08 ` ✓ CI.KUnit: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Thomas Hellström @ 2025-10-27 13:12 UTC (permalink / raw)
  To: intel-xe; +Cc: Thomas Hellström, Maarten Lankhorst, Matthew Brost

The parameter _ret is assigned in xe_validation_guard() not
realizing we're assigning a parameter in a function rather than
in a macro. That means it's value is not propagated to the caller.

Fix this by making the _ret parameter a pointer.

Fixes: c460bc2311df ("drm/xe: Introduce an xe_validation wrapper around drm_exec")
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6220
Cc: Maarten Lankhorst <maarten.lankhorst@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/xe/xe_validation.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_validation.h b/drivers/gpu/drm/xe/xe_validation.h
index fec331d791e7..b2d09c596714 100644
--- a/drivers/gpu/drm/xe/xe_validation.h
+++ b/drivers/gpu/drm/xe/xe_validation.h
@@ -166,10 +166,10 @@ xe_validation_device_init(struct xe_validation_device *val)
  */
 DEFINE_CLASS(xe_validation, struct xe_validation_ctx *,
 	     if (_T) xe_validation_ctx_fini(_T);,
-	     ({_ret = xe_validation_ctx_init(_ctx, _val, _exec, _flags);
-	       _ret ? NULL : _ctx; }),
+	     ({*_ret = xe_validation_ctx_init(_ctx, _val, _exec, _flags);
+	       *_ret ? NULL : _ctx; }),
 	     struct xe_validation_ctx *_ctx, struct xe_validation_device *_val,
-	     struct drm_exec *_exec, const struct xe_val_flags _flags, int _ret);
+	     struct drm_exec *_exec, const struct xe_val_flags _flags, int *_ret);
 static inline void *class_xe_validation_lock_ptr(class_xe_validation_t *_T)
 {return *_T; }
 #define class_xe_validation_is_conditional true
@@ -186,7 +186,7 @@ static inline void *class_xe_validation_lock_ptr(class_xe_validation_t *_T)
  * exhaustive eviction.
  */
 #define xe_validation_guard(_ctx, _val, _exec, _flags, _ret)		\
-	scoped_guard(xe_validation, _ctx, _val, _exec, _flags, _ret) \
+	scoped_guard(xe_validation, _ctx, _val, _exec, _flags, &_ret) \
 	drm_exec_until_all_locked(_exec)
 
 #endif
-- 
2.51.0


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

end of thread, other threads:[~2025-10-28 13:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-27 13:12 [PATCH] drm/xe: Fix uninitialized return value from xe_validation_guard() Thomas Hellström
2025-10-27 16:08 ` ✓ CI.KUnit: success for " Patchwork
2025-10-27 16:20 ` [PATCH] " Lucas De Marchi
2025-10-27 16:52 ` Maarten Lankhorst
2025-10-27 20:11 ` ✗ Xe.CI.Full: failure for " Patchwork
2025-10-27 22:04 ` [PATCH] " Matthew Brost
2025-10-28  8:32 ` ✓ CI.KUnit: success for drm/xe: Fix uninitialized return value from xe_validation_guard() (rev2) Patchwork
2025-10-28  9:12 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-28 13:55 ` ✗ Xe.CI.Full: failure " Patchwork

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