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>
This commit is contained in:
Emil Velikov committed 2015-07-16 16:41:42 +01:00
1 parent ea1786416c
commit c86dabfc9f
1 file changed
+2 -2
+2 -2
View File
@@ -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,