drm/radeon: Calling object_unrefer() when creating fb failure
[linux-2.6.git] / drivers / gpu / drm / radeon / radeon_display.c
index 1f50727..00d9cac 100644 (file)
@@ -1129,8 +1129,10 @@ radeon_user_framebuffer_create(struct drm_device *dev,
        }
 
        radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL);
-       if (radeon_fb == NULL)
+       if (radeon_fb == NULL) {
+               drm_gem_object_unreference_unlocked(obj);
                return ERR_PTR(-ENOMEM);
+       }
 
        ret = radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj);
        if (ret) {