diff mbox

[5/6] drm/i915: Free stolen node on failed preallocation

Message ID 1374088743-23250-1-git-send-email-ben@bwidawsk.net (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Widawsky July 17, 2013, 7:19 p.m. UTC
The odds of this happening are *extremely* unlikely.

Reported-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 46a9715..a893834 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -405,7 +405,7 @@  i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
 					  &obj->gtt_space);
 		if (ret) {
 			DRM_DEBUG_KMS("failed to allocate stolen GTT space\n");
-			goto unref_out;
+			goto err_out;
 		}
 	}
 
@@ -416,7 +416,8 @@  i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
 
 	return obj;
 
-unref_out:
+err_out:
+	drm_mm_put_block(stolen);
 	drm_gem_object_unreference(&obj->base);
 	return NULL;
 }