Commit f7f18184 authored by Ben Widawsky's avatar Ben Widawsky Committed by Daniel Vetter

drm/i915: Free stolen node on failed preallocation

The odds of this happening are *extremely* unlikely.
Reported-by: default avatarImre Deak <imre.deak@intel.com>
Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 5cef07e1
...@@ -402,7 +402,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, ...@@ -402,7 +402,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
&obj->gtt_space); &obj->gtt_space);
if (ret) { if (ret) {
DRM_DEBUG_KMS("failed to allocate stolen GTT space\n"); 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, ...@@ -413,7 +413,8 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
return obj; return obj;
unref_out: err_out:
drm_mm_put_block(stolen);
drm_gem_object_unreference(&obj->base); drm_gem_object_unreference(&obj->base);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment