From f7f181843e6c24644b4b71b8631a5ea87de05158 Mon Sep 17 00:00:00 2001 From: Ben Widawsky Date: Wed, 17 Jul 2013 12:19:02 -0700 Subject: [PATCH] drm/i915: Free stolen node on failed preallocation The odds of this happening are *extremely* unlikely. Reported-by: Imre Deak Signed-off-by: Ben Widawsky Signed-off-by: Daniel Vetter --- 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 90a618335db9..cb527e7930ad 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c @@ -402,7 +402,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; } } @@ -413,7 +413,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; } -- 2.39.5