path: root/src/lib/ecore_drm/ecore_drm_launcher.c
diff options
authorDuna Oh <>2015-12-15 10:02:49 -0500
committerChris Michael <>2015-12-15 10:28:39 -0500
commitcb23fd2af2d07c17ae2d6c08a7c87cf8abf45814 (patch)
tree7c875da34053d84745c259ebd17e84fa260144fd /src/lib/ecore_drm/ecore_drm_launcher.c
parent7fd907a1322ae251ca171f610dcaf06c700565e7 (diff)
ecore-drm: Fix failure of setting/closing evdev->fd which causes fd leak
Summary: When a input device is plugged in, _cb_open_restricted() is called before creating evdev. So setting fd value on evdev was failed in _cb_open_restricted() and also closing evdev->fd was invalid. Using a eina_hash which has 'path-fd' pairs, we can find fd value after evdev is created. @fix Test Plan: (1) Multiple input devices are connected. Their evdev->fd remains zero or initial value. (2) When one of those devices are plugged out, fd leak would happen. Reviewers: raster, zmike, gwanglim, stefan_schmidt, devilhorns, ManMower Subscribers: cedric, jpeg, Jeon, input.hacker Differential Revision:
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm_launcher.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_launcher.c b/src/lib/ecore_drm/ecore_drm_launcher.c
index 2baa550bbf..6ba92ecd2e 100644
--- a/src/lib/ecore_drm/ecore_drm_launcher.c
+++ b/src/lib/ecore_drm/ecore_drm_launcher.c
@@ -167,5 +167,6 @@ _ecore_drm_launcher_device_close(const char *device, int fd)
167{ 167{
168 if ((logind) && (device)) _ecore_drm_logind_device_close(device); 168 if ((logind) && (device)) _ecore_drm_logind_device_close(device);
169 169
170 if (fd < 0) return;
170 close(fd); 171 close(fd);
171} 172}