aboutsummaryrefslogtreecommitdiffstats
path: root/omap
diff options
context:
space:
mode:
authorEmil Velikov2015-07-14 08:59:19 -0500
committerEmil Velikov2015-07-16 10:41:42 -0500
commitc86dabfc9f046e835ddbd01d28c45f9cf7c1f368 (patch)
tree28e5a90717bea82f80adffe4c4cf8310c5cb4ff1 /omap
parentea1786416c58cb0896b640bad5a9e41e1baa4011 (diff)
downloadexternal-libgbm-c86dabfc9f046e835ddbd01d28c45f9cf7c1f368.tar.gz
external-libgbm-c86dabfc9f046e835ddbd01d28c45f9cf7c1f368.tar.xz
external-libgbm-c86dabfc9f046e835ddbd01d28c45f9cf7c1f368.zip
omap: zero is a valid fd number, treat it as such
Equivalent to the previous patch. Cc: Rob Clark <robdclark@gmail.com> Suggested-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'omap')
-rw-r--r--omap/omap_drm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/omap/omap_drm.c b/omap/omap_drm.c
index ff83a930..4a0248d5 100644
--- a/omap/omap_drm.c
+++ b/omap/omap_drm.c
@@ -363,7 +363,7 @@ void omap_bo_del(struct omap_bo *bo)
363 munmap(bo->map, bo->size); 363 munmap(bo->map, bo->size);
364 } 364 }
365 365
366 if (bo->fd) { 366 if (bo->fd >= 0) {
367 close(bo->fd); 367 close(bo->fd);
368 } 368 }
369 369
@@ -414,7 +414,7 @@ uint32_t omap_bo_handle(struct omap_bo *bo)
414 */ 414 */
415int omap_bo_dmabuf(struct omap_bo *bo) 415int omap_bo_dmabuf(struct omap_bo *bo)
416{ 416{
417 if (!bo->fd) { 417 if (bo->fd < 0) {
418 struct drm_prime_handle req = { 418 struct drm_prime_handle req = {
419 .handle = bo->handle, 419 .handle = bo->handle,
420 .flags = DRM_CLOEXEC, 420 .flags = DRM_CLOEXEC,