summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem_stolen.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-14 10:01:32 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-22 13:31:43 +0200
commit4a025e26a2979193739f46e391ffc05cf0637d90 (patch)
treec7026a5e7566572632f548ec669eb4b7ba6323b0 /drivers/gpu/drm/i915/i915_gem_stolen.c
parent4e5aabfd3106cfd68694db416e271996aadf114a (diff)
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>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_stolen.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_stolen.c5
1 files 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 e20d64966c72..7f4c510a751b 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -392,8 +392,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;
}
}
@@ -404,6 +403,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_put_block(stolen);
drm_gem_object_unreference(&obj->base);