Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1228331 > unrolled thread

[PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind()

Started byChristian Engelmayer <cengelma@gmx.at>
First post2015-09-19 00:40 +0200
Last post2015-09-19 00:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind() Christian Engelmayer <cengelma@gmx.at> - 2015-09-19 00:40 +0200
    Re: [PATCH 1/2] drm/vmwgfx: Fix uninitialized return in  vmw_cotable_unbind() "Sinclair Yeh" <syeh@vmware.com> - 2015-09-19 00:50 +0200

#1228331 — [PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind()

FromChristian Engelmayer <cengelma@gmx.at>
Date2015-09-19 00:40 +0200
Subject[PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind()
Message-ID<qactY-7Xb-15@gated-at.bofh.it>
Function vmw_cotable_unbind() uses the uninitialized variable ret as
return value. Make the result deterministic and directly return as
the variable is unused anyway. Detected by Coverity CID 1324256.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
Compile tested only. Applies against linux-next.
---
 drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
index ce659a125f2b..092ea81eeff7 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
@@ -311,7 +311,6 @@ static int vmw_cotable_unbind(struct vmw_resource *res,
 	struct vmw_private *dev_priv = res->dev_priv;
 	struct ttm_buffer_object *bo = val_buf->bo;
 	struct vmw_fence_obj *fence;
-	int ret;
 
 	if (list_empty(&res->mob_head))
 		return 0;
@@ -328,7 +327,7 @@ static int vmw_cotable_unbind(struct vmw_resource *res,
 	if (likely(fence != NULL))
 		vmw_fence_obj_unreference(&fence);
 
-	return ret;
+	return 0;
 }
 
 /**
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1228332 — Re: [PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind()

From"Sinclair Yeh" <syeh@vmware.com>
Date2015-09-19 00:50 +0200
SubjectRe: [PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind()
Message-ID<qacDD-88x-3@gated-at.bofh.it>
In reply to#1228331
Good catch!

Reviewed-by: Sinclair Yeh <syeh@vmware.com>

On Sat, Sep 19, 2015 at 12:31:10AM +0200, Christian Engelmayer wrote:
> Function vmw_cotable_unbind() uses the uninitialized variable ret as
> return value. Make the result deterministic and directly return as
> the variable is unused anyway. Detected by Coverity CID 1324256.
> 
> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
> ---
> Compile tested only. Applies against linux-next.
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
> index ce659a125f2b..092ea81eeff7 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
> @@ -311,7 +311,6 @@ static int vmw_cotable_unbind(struct vmw_resource *res,
>  	struct vmw_private *dev_priv = res->dev_priv;
>  	struct ttm_buffer_object *bo = val_buf->bo;
>  	struct vmw_fence_obj *fence;
> -	int ret;
>  
>  	if (list_empty(&res->mob_head))
>  		return 0;
> @@ -328,7 +327,7 @@ static int vmw_cotable_unbind(struct vmw_resource *res,
>  	if (likely(fence != NULL))
>  		vmw_fence_obj_unreference(&fence);
>  
> -	return ret;
> +	return 0;
>  }
>  
>  /**
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web