summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhaowei Yuan <zhaowei.yuan@samsung.com>2019-06-19 10:49:59 +0800
committerZhaowei Yuan <zhaowei.yuan@samsung.com>2019-06-19 10:49:59 +0800
commit560c13e37479db32e4c8cb2f969966c9a6d94791 (patch)
tree6f6854cede266e1d541da3c255bdeaf51beeb978
parentfee4a2053305a9b976e88b85a1c63064127e791b (diff)
downloadmesa-560c13e37479db32e4c8cb2f969966c9a6d94791.tar.gz
mesa-560c13e37479db32e4c8cb2f969966c9a6d94791.tar.bz2
mesa-560c13e37479db32e4c8cb2f969966c9a6d94791.zip
close tbm_bufmgr_fd and dri2_dpy->fd after used
tbm_bufmgr_fd is got from dup(), and dri2_dpy->fd is assigned by tbm_bufmgr_fd or is received from socket, they both need to be closed after used Change-Id: I75b91408ee278e716d383ca2dbc696955245a08b Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
-rwxr-xr-x[-rw-r--r--]src/egl/drivers/dri2/platform_tizen.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c
index 353cfd5ff3d..e407b559ae7 100644..100755
--- a/src/egl/drivers/dri2/platform_tizen.c
+++ b/src/egl/drivers/dri2/platform_tizen.c
@@ -1632,6 +1632,13 @@ dri2_initialize_tizen(_EGLDriver *drv, _EGLDisplay *disp)
goto cleanup_screen;;
}
+ if(dri2_dpy->fd != tbm_bufmgr_fd) {
+ close(dri2_dpy->fd);
+ }
+ close(tbm_bufmgr_fd);
+ tbm_bufmgr_fd = -1;
+ dri2_dpy->fd = -1;
+
disp->Device = dev;
if (!dri2_setup_extensions(disp)) {