All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/rtp: Check hwe before calling match_func
@ 2026-05-28 21:34 Jonathan Cavitt
  2026-05-28 21:46 ` Cavitt, Jonathan
  2026-05-28 22:29 ` Gustavo Sousa
  0 siblings, 2 replies; 5+ messages in thread
From: Jonathan Cavitt @ 2026-05-28 21:34 UTC (permalink / raw)
  To: dri-devel; +Cc: saurabhg.gupta, alex.zuo, jonathan.cavitt, gustavo.sousa

XE_RTP_MATCH_FUNC may attempt to dereference the target xe_hw_engine.
Ensure the hwe is not NULL before calling the function, matching
XE_RTP_MATCH_ENGINE_CLASS, for example.

This covers a static analysis issue.

Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Gustavo Sousa <gustavo.sousa@intel.com>
---
 drivers/gpu/drm/xe/xe_rtp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_rtp.c b/drivers/gpu/drm/xe/xe_rtp.c
index dec9d94e6fb0..2cd26db113d9 100644
--- a/drivers/gpu/drm/xe/xe_rtp.c
+++ b/drivers/gpu/drm/xe/xe_rtp.c
@@ -129,6 +129,9 @@ static bool rule_match_item(struct rule_match_ctx *match_ctx)
 
 		return hwe->class != r->engine_class;
 	case XE_RTP_MATCH_FUNC:
+		if (drm_WARN_ON(&xe->drm, !hwe))
+			return false;
+
 		return r->match_func(xe, gt, hwe);
 	default:
 		drm_warn(&xe->drm, "Invalid RTP match %u\n",
-- 
2.53.0


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

end of thread, other threads:[~2026-05-29 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28 21:34 [PATCH] drm/xe/rtp: Check hwe before calling match_func Jonathan Cavitt
2026-05-28 21:46 ` Cavitt, Jonathan
2026-05-28 22:29 ` Gustavo Sousa
2026-05-29 14:03   ` Cavitt, Jonathan
2026-05-29 15:07     ` Gustavo Sousa

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.