public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Clean-up idr table if context create fails.
@ 2015-03-30 14:33 deepak.s
  2015-03-30 15:43 ` Daniel Vetter
  2015-03-30 17:06 ` shuang.he
  0 siblings, 2 replies; 9+ messages in thread
From: deepak.s @ 2015-03-30 14:33 UTC (permalink / raw)
  To: intel-gfx

From: Deepak S <deepak.s@linux.intel.com>

Cleanup idr table if any error happens after __create_hw_context() in
i915_gem_create_context()

Signed-off-by: Deepak S <deepak.s@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index f3e84c4..69bebe5 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -287,6 +287,8 @@ err_unpin:
 	if (is_global_default_ctx && ctx->legacy_hw_ctx.rcs_state)
 		i915_gem_object_ggtt_unpin(ctx->legacy_hw_ctx.rcs_state);
 err_destroy:
+	if (ctx->file_priv)
+		idr_remove(&ctx->file_priv->context_idr, ctx->user_handle);
 	i915_gem_context_unreference(ctx);
 	return ERR_PTR(ret);
 }
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-04-07 15:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 14:33 [PATCH] drm/i915: Clean-up idr table if context create fails deepak.s
2015-03-30 15:43 ` Daniel Vetter
2015-04-02 13:19   ` Deepak S
2015-04-02 13:22     ` [PATCH v2] " deepak.s
2015-04-02 23:00       ` shuang.he
2015-04-07  8:20     ` [PATCH] " Daniel Vetter
2015-04-07  8:32       ` Chris Wilson
2015-04-07 15:11         ` Deepak S
2015-03-30 17:06 ` shuang.he

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