From c86dabfc9f046e835ddbd01d28c45f9cf7c1f368 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Tue, 14 Jul 2015 14:59:19 +0100 Subject: omap: zero is a valid fd number, treat it as such Equivalent to the previous patch. Cc: Rob Clark Suggested-by: Thierry Reding Signed-off-by: Emil Velikov Reviewed-by: Thierry Reding --- omap/omap_drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'omap') 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) munmap(bo->map, bo->size); } - if (bo->fd) { + if (bo->fd >= 0) { close(bo->fd); } @@ -414,7 +414,7 @@ uint32_t omap_bo_handle(struct omap_bo *bo) */ int omap_bo_dmabuf(struct omap_bo *bo) { - if (!bo->fd) { + if (bo->fd < 0) { struct drm_prime_handle req = { .handle = bo->handle, .flags = DRM_CLOEXEC, -- cgit v1.2.3