Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1618bdb8 authored by Chris Wilson's avatar Chris Wilson
Browse files

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161125131718.20978-2-chris@chris-wilson.co.uk
parent 4ffd6e0c
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -599,6 +599,11 @@ i915_gem_request_alloc(struct intel_engine_cs *engine,
	return req;
	return req;


err_ctx:
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);
	i915_gem_context_put(ctx);
	kmem_cache_free(dev_priv->requests, req);
	kmem_cache_free(dev_priv->requests, req);
err_unreserve:
err_unreserve: