Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915: Fixed NULL pointer dereference in capture_engine
@ 2024-11-20 15:03 Eugene Kobyak
  2024-11-20 15:12 ` Andi Shyti
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eugene Kobyak @ 2024-11-20 15:03 UTC (permalink / raw)
  To: intel-gfx; +Cc: andi.shyti, John.C.Harrison

When the intel_context structure contains NULL,
it raises a NULL pointer dereference error in drm_info().

This patch aims to resolve issue:
https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12309

Signed-off-by: Eugene Kobyak <eugene.kobyak@intel.com>
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 135ded17334e..acf403e4e5d6 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1643,9 +1643,12 @@ capture_engine(struct intel_engine_cs *engine,
 		return NULL;
 
 	intel_engine_get_hung_entity(engine, &ce, &rq);
-	if (rq && !i915_request_started(rq))
+	if (rq && !i915_request_started(rq)) {
+		u16 guc_id = ce ? ce->guc_id.id : 0;
+
 		drm_info(&engine->gt->i915->drm, "Got hung context on %s with active request %lld:%lld [0x%04X] not yet started\n",
-			 engine->name, rq->fence.context, rq->fence.seqno, ce->guc_id.id);
+			 engine->name, rq->fence.context, rq->fence.seqno, guc_id);
+	}
 
 	if (rq) {
 		capture = intel_engine_coredump_add_request(ee, rq, ATOMIC_MAYFAIL);
-- 
2.34.1


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

end of thread, other threads:[~2024-11-21 23:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-20 15:03 [PATCH v2] drm/i915: Fixed NULL pointer dereference in capture_engine Eugene Kobyak
2024-11-20 15:12 ` Andi Shyti
2024-11-20 15:55 ` ✓ Fi.CI.BAT: success for drm/i915: Fixed NULL pointer dereference in capture_engine (rev2) Patchwork
2024-11-21  9:24 ` ✗ i915.CI.Full: failure " Patchwork
2024-11-21 23:44 ` [PATCH v2] drm/i915: Fixed NULL pointer dereference in capture_engine John Harrison

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