summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-11-04 12:44:29 -0500
committerChris Michael <cp.michael@samsung.com>2015-11-04 12:44:29 -0500
commitf77ba645d58d8a544c0723b3ebc8f8668d7cdd59 (patch)
treeed4982f2249e3b3421dbc9dd3b1328de3889069a
parent962059dd0a4121ba93c3cb7179173d628b37f8f7 (diff)
ecore-drm: Check return value of drmHandleEvent and cleanup
Summary: drmHandleEvent will return 0 on success, or -1 on error. We should trap for the error case so that we can cleanup any allocated callback structures. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm/ecore_drm_fb.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_fb.c b/src/lib/ecore_drm/ecore_drm_fb.c
index 780516795b..68c7e94bb7 100644
--- a/src/lib/ecore_drm/ecore_drm_fb.c
+++ b/src/lib/ecore_drm/ecore_drm_fb.c
@@ -257,5 +257,15 @@ ecore_drm_fb_send(Ecore_Drm_Device *dev, Ecore_Drm_Fb *fb, Ecore_Drm_Pageflip_Cb
257 } 257 }
258 258
259 while (fb->pending_flip) 259 while (fb->pending_flip)
260 drmHandleEvent(dev->drm.fd, &dev->drm_ctx); 260 {
261 int ret = 0;
262
263 ret = drmHandleEvent(dev->drm.fd, &dev->drm_ctx);
264 if (ret < 0)
265 {
266 ERR("drmHandleEvent Failed: %m");
267 free(cb);
268 break;
269 }
270 }
261} 271}