aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_fb.c
diff options
context:
space:
mode:
authorTomi Valkeinen <[email protected]>2017-08-04 09:20:03 +0000
committerTomi Valkeinen <[email protected]>2017-08-15 12:18:25 +0000
commit95552191f0a0c3632808d8883fc05d37a5c2fe14 (patch)
treed1cb367bd8d7f572333595be925cc2dbc1467d97 /drivers/gpu/drm/omapdrm/omap_fb.c
parentBackmerge tag 'v4.13-rc5' into drm-next (diff)
downloadkernel-95552191f0a0c3632808d8883fc05d37a5c2fe14.tar.gz
kernel-95552191f0a0c3632808d8883fc05d37a5c2fe14.zip
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 <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_fb.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_fb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index ddf7a457951b..b1a762b70cbf 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -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;