All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Dongli Zhang <dongli.zhang@oracle.com>, <ian.campbell@citrix.com>
Cc: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/1] xen-netfront: uninitialized fields in xenvif_rx_action
Date: Tue, 2 Feb 2016 10:25:37 +0000	[thread overview]
Message-ID: <56B08421.5000302@citrix.com> (raw)
In-Reply-To: <1454394031.2873.10.camel@linux>

On 02/02/16 06:20, Dongli Zhang wrote:
> While npo.copy and npo.meta are initialized in xenvif_rx_action, fields
> such as npo.meta_prod are directly used later in xenvif_gop_skb without
> being initialized first. Although the output of xenvif_rx_action is based
> on the difference between new npo->meta_prod and old npo->meta_prod, it is
> better to initialize them to 0 at the beginning.

Fields that are omitted from an initializer are initialized to zero.  So
this patch is not needed.

David

> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -560,6 +560,10 @@ static void xenvif_rx_action(struct xenvif_queue *queue)
>  	bool need_to_notify = false;
>  
>  	struct netrx_pending_operations npo = {
> +		.copy_prod = 0,
> +		.copy_cons = 0,
> +		.meta_prod = 0,
> +		.meta_cons = 0,
>  		.copy  = queue->grant_copy_op,
>  		.meta  = queue->meta,
>  	};
> 

  reply	other threads:[~2016-02-02 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02  6:20 [PATCH 1/1] xen-netfront: uninitialized fields in xenvif_rx_action Dongli Zhang
2016-02-02 10:25 ` David Vrabel [this message]
2016-02-02 10:25 ` David Vrabel

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=56B08421.5000302@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=dongli.zhang@oracle.com \
    --cc=ian.campbell@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.