summaryrefslogtreecommitdiff
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
parent92553e167e6c03611e299f41fe538f8963e45723 (diff)
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)
133 EINA_SAFETY_ON_NULL_RETURN_VAL(device, -1); 133 EINA_SAFETY_ON_NULL_RETURN_VAL(device, -1);
134 134
135 device->fd = elput_manager_open(device->em, device->path, -1); 135 device->fd = elput_manager_open(device->em, device->path, -1);
136 if (device->fd < 0) goto open_err;
136 137
137 if (!elput_input_init(device->em, NULL)) 138 if (!elput_input_init(device->em, NULL))
138 { 139 {
139 ERR("Could not initialize Elput Input"); 140 ERR("Could not initialize Elput Input");
140 goto err; 141 goto input_err;
141 } 142 }
142 143
143 DBG("Device Path: %s", device->path); 144 DBG("Device Path: %s", device->path);
@@ -153,8 +154,9 @@ ecore_drm2_device_open(Ecore_Drm2_Device *device)
153 154
154 return device->fd; 155 return device->fd;
155 156
156err: 157input_err:
157 elput_manager_close(device->em, device->fd); 158 elput_manager_close(device->em, device->fd);
159open_err:
158 return -1; 160 return -1;
159} 161}
160 162