aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_drm2/ecore_drm2_device.c
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-05-14 04:13:38 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-05-27 11:57:53 -0400
commit8b3e05a7f1d5f7e96047d6c11d6e807c96a3b5ed (patch)
tree89a7c4cfd8e2b67e707493ae1b131215da1b617c /src/lib/ecore_drm2/ecore_drm2_device.c
parentecore-drm2: Initialize elput input when device gets opened (diff)
downloadefl-8b3e05a7f1d5f7e96047d6c11d6e807c96a3b5ed.tar.gz
ecore-drm2: Check return of elput_manager_open
We should check to make sure that opening the device has succeeded before trying to continue Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_device.c')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 530adcf6d9..5c42902940 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -133,11 +133,12 @@ ecore_drm2_device_open(Ecore_Drm2_Device *device)
EINA_SAFETY_ON_NULL_RETURN_VAL(device, -1);
device->fd = elput_manager_open(device->em, device->path, -1);
+ if (device->fd < 0) goto open_err;
if (!elput_input_init(device->em, NULL))
{
ERR("Could not initialize Elput Input");
- goto err;
+ goto input_err;
}
DBG("Device Path: %s", device->path);
@@ -153,8 +154,9 @@ ecore_drm2_device_open(Ecore_Drm2_Device *device)
return device->fd;
-err:
+input_err:
elput_manager_close(device->em, device->fd);
+open_err:
return -1;
}