summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm.c
diff options
context:
space:
mode:
authorDuna Oh <duna.oh@samsung.com>2015-12-15 10:02:49 -0500
committerChris Michael <cpmichael@osg.samsung.com>2015-12-15 10:28:39 -0500
commitcb23fd2af2d07c17ae2d6c08a7c87cf8abf45814 (patch)
tree7c875da34053d84745c259ebd17e84fa260144fd /src/lib/ecore_drm/ecore_drm.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: https://phab.enlightenment.org/D3428
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm.c')
-rw-r--r--src/lib/ecore_drm/ecore_drm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm.c b/src/lib/ecore_drm/ecore_drm.c
index 6bbbde05d7..02dd76edbb 100644
--- a/src/lib/ecore_drm/ecore_drm.c
+++ b/src/lib/ecore_drm/ecore_drm.c
@@ -87,6 +87,8 @@ ecore_drm_init(void)
87 /* try to init eeze */ 87 /* try to init eeze */
88 if (!eeze_init()) goto eeze_err; 88 if (!eeze_init()) goto eeze_err;
89 89
90 _ecore_drm_inputs_init();
91
90 ECORE_DRM_EVENT_ACTIVATE = ecore_event_type_new(); 92 ECORE_DRM_EVENT_ACTIVATE = ecore_event_type_new();
91 ECORE_DRM_EVENT_OUTPUT = ecore_event_type_new(); 93 ECORE_DRM_EVENT_OUTPUT = ecore_event_type_new();
92 ECORE_DRM_EVENT_SEAT_ADD = ecore_event_type_new(); 94 ECORE_DRM_EVENT_SEAT_ADD = ecore_event_type_new();
@@ -141,6 +143,8 @@ ecore_drm_shutdown(void)
141 /* shutdown eina */ 143 /* shutdown eina */
142 eina_shutdown(); 144 eina_shutdown();
143 145
146 _ecore_drm_inputs_shutdown();
147
144 /* return init count */ 148 /* return init count */
145 return _ecore_drm_init_count; 149 return _ecore_drm_init_count;
146} 150}