Unverified Commit 856e5fa6 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14785 drm/i915: Fix NULL pointer dereference in capture_engine

parents 38f77d70 56e2b4e9
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -1638,9 +1638,21 @@ capture_engine(struct intel_engine_cs *engine,
		return NULL;

	intel_engine_get_hung_entity(engine, &ce, &rq);
	if (rq && !i915_request_started(rq))
		drm_info(&engine->gt->i915->drm, "Got hung context on %s with active request %lld:%lld [0x%04X] not yet started\n",
	if (rq && !i915_request_started(rq)) {
		/*
		 * We want to know also what is the guc_id of the context,
		 * but if we don't have the context reference, then skip
		 * printing it.
		 */
		if (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);
		else
			drm_info(&engine->gt->i915->drm,
				 "Got hung context on %s with active request %lld:%lld not yet started\n",
				 engine->name, rq->fence.context, rq->fence.seqno);
	}

	if (rq) {
		capture = intel_engine_coredump_add_request(ee, rq, ATOMIC_MAYFAIL);