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: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
Tomi Valkeinen 2017-08-04 12:20:03 +03:00
parent 0c697fafc6
commit 95552191f0
1 changed files with 1 additions and 1 deletions

View File

@ -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;