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>
main
Emil Velikov 2015-07-14 14:59:19 +01:00
parent ea1786416c
commit c86dabfc9f
1 changed files with 2 additions and 2 deletions

View File

@ -363,7 +363,7 @@ void omap_bo_del(struct omap_bo *bo)
munmap(bo->map, bo->size); munmap(bo->map, bo->size);
} }
if (bo->fd) { if (bo->fd >= 0) {
close(bo->fd); close(bo->fd);
} }
@ -414,7 +414,7 @@ uint32_t omap_bo_handle(struct omap_bo *bo)
*/ */
int omap_bo_dmabuf(struct omap_bo *bo) int omap_bo_dmabuf(struct omap_bo *bo)
{ {
if (!bo->fd) { if (bo->fd < 0) {
struct drm_prime_handle req = { struct drm_prime_handle req = {
.handle = bo->handle, .handle = bo->handle,
.flags = DRM_CLOEXEC, .flags = DRM_CLOEXEC,