提交 95552191 编写于 作者: T Tomi Valkeinen

drm/omap: fix memory leak when FB init fails

omap_framebuffer_create() fails to unref all the gem objects if creating
the FB fails, leading to a memory leak.

Fix the loop so that it goes through all the reffed gem objects.
Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
上级 0c697faf
......@@ -379,7 +379,7 @@ struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
return fb;
error:
while (--i > 0)
while (--i >= 0)
drm_gem_object_unreference_unlocked(bos[i]);
return fb;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册