From: Dongli Zhang <dongli.zhang@oracle.com>
To: ian.campbell@citrix.com
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] xen-netfront: uninitialized fields in xenvif_rx_action
Date: Tue, 02 Feb 2016 14:20:31 +0800 [thread overview]
Message-ID: <1454394031.2873.10.camel@linux> (raw)
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.
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
drivers/net/xen-netback/netback.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 61b97c3..32f0fbd 100644
--- 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,
};
--
1.9.1
next reply other threads:[~2016-02-02 6:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 6:20 Dongli Zhang [this message]
2016-02-02 10:25 ` [Xen-devel] [PATCH 1/1] xen-netfront: uninitialized fields in xenvif_rx_action 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=1454394031.2873.10.camel@linux \
--to=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 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).