Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;
}