]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/i915: Free stolen node on failed preallocation
authorBen Widawsky <ben@bwidawsk.net>
Wed, 17 Jul 2013 19:19:02 +0000 (12:19 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 17 Jul 2013 20:24:51 +0000 (22:24 +0200)
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>
drivers/gpu/drm/i915/i915_gem_stolen.c

index 90a618335db9f614534f9e329a86de6ec0a8db8e..cb527e7930ad91fc3e2e407b293d8d43fa4750d6 100644 (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;
 }