public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Sinclair Yeh" <syeh@vmware.com>
To: Christian Engelmayer <cengelma@gmx.at>
Cc: airlied@linux.ie, thellstrom@vmware.com, brianp@vmware.com,
	charmainel@vmware.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/vmwgfx: Fix uninitialized return in vmw_cotable_unbind()
Date: Fri, 18 Sep 2015 15:42:14 -0700	[thread overview]
Message-ID: <20150918224214.GA18173@syeh-linux> (raw)
In-Reply-To: <1442615470-22149-1-git-send-email-cengelma@gmx.at>

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
> 

      reply	other threads:[~2015-09-18 22:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150918224214.GA18173@syeh-linux \
    --to=syeh@vmware.com \
    --cc=airlied@linux.ie \
    --cc=brianp@vmware.com \
    --cc=cengelma@gmx.at \
    --cc=charmainel@vmware.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thellstrom@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox