* [PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind()
@ 2015-09-18 22:31 Christian Engelmayer
2015-09-18 22:42 ` Sinclair Yeh
0 siblings, 1 reply; 2+ messages in thread
From: Christian Engelmayer @ 2015-09-18 22:31 UTC (permalink / raw)
To: airlied
Cc: syeh, thellstrom, brianp, charmainel, dri-devel, linux-kernel,
Christian Engelmayer
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind()
2015-09-18 22:31 [PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind() Christian Engelmayer
@ 2015-09-18 22:42 ` Sinclair Yeh
0 siblings, 0 replies; 2+ messages in thread
From: Sinclair Yeh @ 2015-09-18 22:42 UTC (permalink / raw)
To: Christian Engelmayer
Cc: airlied, thellstrom, brianp, charmainel, dri-devel, linux-kernel
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-18 22:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-18 22:31 [PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind() Christian Engelmayer
2015-09-18 22:42 ` Sinclair Yeh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).