1
0
Fork 0

drm/i915: Free stolen node on failed preallocation

The odds of this happening are *extremely* unlikely.

Reported-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
hifive-unleashed-5.1
Ben Widawsky 2013-07-17 12:19:02 -07:00 committed by Daniel Vetter
parent 5cef07e162
commit f7f181843e
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}