All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Free resources correctly if we cannot map status page during ctx create
@ 2014-11-17 15:48 Arun Siluvery
  2014-11-17 15:54 ` Daniel, Thomas
  2014-11-17 19:04 ` Daniel Vetter
  0 siblings, 2 replies; 8+ messages in thread
From: Arun Siluvery @ 2014-11-17 15:48 UTC (permalink / raw)
  To: intel-gfx

We are not freeing memory allocated for ringbuf and ctx if we fail
to map status page so release all resources correctly.

Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index f3efdbd..a84d24b 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1777,8 +1777,10 @@ int intel_lr_context_deferred_create(struct intel_context *ctx,
 		ring->status_page.gfx_addr = i915_gem_obj_ggtt_offset(ctx_obj);
 		ring->status_page.page_addr =
 				kmap(sg_page(ctx_obj->pages->sgl));
-		if (ring->status_page.page_addr == NULL)
-			return -ENOMEM;
+		if (ring->status_page.page_addr == NULL) {
+			ret = -ENOMEM;
+			goto error;
+		}
 		ring->status_page.obj = ctx_obj;
 	}
 
-- 
2.1.2

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

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

end of thread, other threads:[~2014-11-18 15:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-17 15:48 [PATCH] drm/i915: Free resources correctly if we cannot map status page during ctx create Arun Siluvery
2014-11-17 15:54 ` Daniel, Thomas
2014-11-17 15:57   ` Siluvery, Arun
2014-11-17 19:04 ` Daniel Vetter
2014-11-18  7:44   ` Chris Wilson
2014-11-18  8:05     ` Daniel Vetter
2014-11-18  8:10     ` [PATCH] drm/i915: Drop return value from lrc_setup_hardware_status_page Daniel Vetter
2014-11-18 15:31       ` [PATCH] drm/i915: Drop return value from shuang.he

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.