提交 ca40ba85 编写于 作者: L Lukas Wunner 提交者: Jani Nikula

drm/i915: Fix double unref in intelfb_alloc failure path

In intelfb_alloc(), if the call to intel_pin_and_fence_fb_obj() fails,
the bo is unrefed twice: By drm_framebuffer_remove() and once more by
drm_gem_object_unreference(). Fix it.
Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: NLukas Wunner <lukas@wunner.de>
Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/cd7b33330621a350b0159ec5e098297b139cfaf7.1446892879.git.lukas@wunner.deSigned-off-by: NJani Nikula <jani.nikula@intel.com>
上级 dcb1394e
...@@ -156,8 +156,9 @@ static int intelfb_alloc(struct drm_fb_helper *helper, ...@@ -156,8 +156,9 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
fb = __intel_framebuffer_create(dev, &mode_cmd, obj); fb = __intel_framebuffer_create(dev, &mode_cmd, obj);
if (IS_ERR(fb)) { if (IS_ERR(fb)) {
drm_gem_object_unreference(&obj->base);
ret = PTR_ERR(fb); ret = PTR_ERR(fb);
goto out_unref; goto out;
} }
/* Flush everything out, we'll be doing GTT only from now on */ /* Flush everything out, we'll be doing GTT only from now on */
...@@ -173,8 +174,6 @@ static int intelfb_alloc(struct drm_fb_helper *helper, ...@@ -173,8 +174,6 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
out_fb: out_fb:
drm_framebuffer_remove(fb); drm_framebuffer_remove(fb);
out_unref:
drm_gem_object_unreference(&obj->base);
out: out:
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册