blob: d75f2cf47835d4feb5020f20275d69846dff8c2b [file] [log] [blame]
From f9e3aa3b0256cd858bed801e3ff2b2eb3599696e Mon Sep 17 00:00:00 2001
From: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed, 14 Aug 2013 10:01:32 +0200
Subject: drm/i915: clarify error paths in create_stolen_for_preallocated
Use the standard inversely ordered goto label stack for everything.
Spotted while reviewing place where we might need to to call
vma_destroy but failed to do so.
Cc: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 4a025e26a2979193739f46e391ffc05cf0637d90)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
drivers/gpu/drm/i915/i915_gem_stolen.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 8b03327f74b9..9969d10b80f5 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -409,8 +409,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
ret = drm_mm_reserve_node(&ggtt->mm, &vma->node);
if (ret) {
DRM_DEBUG_KMS("failed to allocate stolen GTT space\n");
- i915_gem_vma_destroy(vma);
- goto err_out;
+ goto err_vma;
}
}
@@ -421,6 +420,8 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
return obj;
+err_vma:
+ i915_gem_vma_destroy(vma);
err_out:
drm_mm_remove_node(stolen);
kfree(stolen);
--
1.8.5.rc3