Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] drm/i915: Fix NULL pointer dereference in capture_engine
@ 2024-11-28 21:28 Eugene Kobyak
  2024-11-28 22:34 ` ✓ i915.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Eugene Kobyak @ 2024-11-28 21:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: John.C.Harrison, andi.shyti, jani.nikula

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

Fixes: e8a3319c31a1 ("drm/i915: Allow error capture without a request")
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12309
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: <stable@vger.kernel.org> # v6.3+
Signed-off-by: Eugene Kobyak <eugene.kobyak@intel.com>
---
v2:
  - return drm_info to separate condition
v3:
  - create separate condition which generate string if intel_context exist
v4:
  - rollback and add check intel_context in log condition
 drivers/gpu/drm/i915/i915_gpu_error.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 135ded17334e..56f05a18870c 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1643,7 +1643,7 @@ 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) && ce)
 		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);
 
-- 
2.34.1

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

end of thread, other threads:[~2024-12-02 19:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-28 21:28 [PATCH v4] drm/i915: Fix NULL pointer dereference in capture_engine Eugene Kobyak
2024-11-28 22:34 ` ✓ i915.CI.BAT: success for " Patchwork
2024-11-28 23:06 ` [PATCH v4] " Andi Shyti
2024-11-29  2:32 ` John Harrison
2024-11-29 12:12   ` Andi Shyti
2024-12-02 19:28     ` John Harrison
2024-11-29  3:07 ` ✗ i915.CI.Full: failure for " Patchwork

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