summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem_request.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-11-25 16:17:16 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2016-11-25 16:49:24 +0300
commit1618bdb89b5d8b47edf42d9c6ea96ecf001ad625 (patch)
treedc5ee929bd7a58518a4c008ee089a280c6f4e877 /drivers/gpu/drm/i915/i915_gem_request.c
parent4ffd6e0cfe1816fced8ab8d2612e1edde81aac2a (diff)
downloadlinux-1618bdb89b5d8b47edf42d9c6ea96ecf001ad625.tar.xz
drm/i915: Assert no external observers when unwind a failed request alloc
Before we return the request back to the kmem_cache after a failed i915_gem_request_alloc(), we should assert that it has not been added to any global state tracking. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161125131718.20978-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_request.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_request.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index bd7b21f70283..ed6cead22a86 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -599,6 +599,11 @@ i915_gem_request_alloc(struct intel_engine_cs *engine,
return req;
err_ctx:
+ /* Make sure we didn't add ourselves to external state before freeing */
+ GEM_BUG_ON(!list_empty(&req->active_list));
+ GEM_BUG_ON(!list_empty(&req->priotree.signalers_list));
+ GEM_BUG_ON(!list_empty(&req->priotree.waiters_list));
+
i915_gem_context_put(ctx);
kmem_cache_free(dev_priv->requests, req);
err_unreserve: