Commit 0b05e1e0 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Don't leak framebuffer_references if drm_framebuffer_init() fails

Don't increment obj->framebuffer_references until we know we actually
managed to create the framebuffer.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1452777736-4909-2-git-send-email-ville.syrjala@linux.intel.com
parent 013dd9e0
...@@ -14905,7 +14905,6 @@ static int intel_framebuffer_init(struct drm_device *dev, ...@@ -14905,7 +14905,6 @@ static int intel_framebuffer_init(struct drm_device *dev,
drm_helper_mode_fill_fb_struct(&intel_fb->base, mode_cmd); drm_helper_mode_fill_fb_struct(&intel_fb->base, mode_cmd);
intel_fb->obj = obj; intel_fb->obj = obj;
intel_fb->obj->framebuffer_references++;
ret = drm_framebuffer_init(dev, &intel_fb->base, &intel_fb_funcs); ret = drm_framebuffer_init(dev, &intel_fb->base, &intel_fb_funcs);
if (ret) { if (ret) {
...@@ -14913,6 +14912,8 @@ static int intel_framebuffer_init(struct drm_device *dev, ...@@ -14913,6 +14912,8 @@ static int intel_framebuffer_init(struct drm_device *dev,
return ret; return ret;
} }
intel_fb->obj->framebuffer_references++;
return 0; return 0;
} }
......
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