From: "Sinclair Yeh" <syeh@vmware.com>
To: Christian Engelmayer <cengelma@gmx.at>
Cc: airlied@linux.ie, thellstrom@vmware.com, daniel.vetter@ffwll.ch,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] drm/vmwgfx: Fix uninitialized return in vmw_kms_helper_dirty()
Date: Fri, 18 Sep 2015 15:42:50 -0700 [thread overview]
Message-ID: <20150918224234.GB18173@syeh-linux> (raw)
In-Reply-To: <1442615544-22203-1-git-send-email-cengelma@gmx.at>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
On Sat, Sep 19, 2015 at 12:32:24AM +0200, Christian Engelmayer wrote:
> Function vmw_kms_helper_dirty() 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 1324255.
>
> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
> ---
> Compile tested only. Applies against linux-next.
> ---
> drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> index 61fb7f3de311..15a6c01cd016 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> @@ -1685,7 +1685,6 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv,
> struct drm_crtc *crtc;
> u32 num_units = 0;
> u32 i, k;
> - int ret;
>
> dirty->dev_priv = dev_priv;
>
> @@ -1711,7 +1710,7 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv,
> if (!dirty->cmd) {
> DRM_ERROR("Couldn't reserve fifo space "
> "for dirty blits.\n");
> - return ret;
> + return -ENOMEM;
> }
> memset(dirty->cmd, 0, dirty->fifo_reserve_size);
> }
> --
> 1.9.1
>
prev parent reply other threads:[~2015-09-18 22:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 22:32 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=20150918224234.GB18173@syeh-linux \
--to=syeh@vmware.com \
--cc=airlied@linux.ie \
--cc=cengelma@gmx.at \
--cc=daniel.vetter@ffwll.ch \
--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
all inboxes | Powered by JetHome®