From 5b5554c51d38a227c4c5bee6e57026e4ebb0bde9 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 8 Mar 2017 14:22:38 +0000 Subject: [PATCH] drm/i915: Check for an invalid seqno before __i915_gem_request_started MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit __i915_gem_request_started() asserts that the seqno is valid, but i915_spin_request() was not checking before querying whether the request had started. Reported-by: Michał Winiarski Fixes: 754c9fd57649 ("drm/i915: Protect the request->global_seqno with the engine->timeline lock") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Michał Winiarski Link: http://patchwork.freedesktop.org/patch/msgid/20170308142238.22994-1-chris@chris-wilson.co.uk Reviewed-by: Michał Winiarski Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/i915_gem_request.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h index 5018e55922f0..0cef887b0de4 100644 --- a/drivers/gpu/drm/i915/i915_gem_request.h +++ b/drivers/gpu/drm/i915/i915_gem_request.h @@ -348,6 +348,9 @@ static inline bool i915_spin_request(const struct drm_i915_gem_request *request, u32 seqno; seqno = i915_gem_request_global_seqno(request); + if (!seqno) + return 0; + return (__i915_gem_request_started(request, seqno) && __i915_spin_request(request, seqno, state, timeout_us)); } -- 2.20.1