[libdrm,2/4] omap: zero is a valid fd number, treat it as such
diff mbox

Message ID 1436883005-6163-2-git-send-email-emil.l.velikov@gmail.com
State New
Headers show

Commit Message

Emil Velikov July 14, 2015, 2:10 p.m. UTC
Equivalent to the previous patch.

Cc: Rob Clark <robdclark@gmail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Suggested-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 omap/omap_drm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thierry Reding July 15, 2015, 11:30 a.m. UTC | #1
On Tue, Jul 14, 2015 at 03:10:03PM +0100, Emil Velikov wrote:
> Equivalent to the previous patch.
> 
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Suggested-by: Thierry Reding <thierry.reding@gmail.com>
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
> ---
>  omap/omap_drm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Thierry Reding <treding@nvidia.com>

> diff --git a/omap/omap_drm.c b/omap/omap_drm.c
> index ff83a93..4a0248d 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,
> -- 
> 2.4.5
>

Patch
diff mbox

diff --git a/omap/omap_drm.c b/omap/omap_drm.c
index ff83a93..4a0248d 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,