From patchwork Tue Feb 2 06:20:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongli Zhang X-Patchwork-Id: 8187121 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8AFF79F4DD for ; Tue, 2 Feb 2016 06:54:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B81102020F for ; Tue, 2 Feb 2016 06:54:11 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC0B7201EF for ; Tue, 2 Feb 2016 06:54:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aQUo3-0004uC-33; Tue, 02 Feb 2016 06:51:19 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aQUJe-0003su-7r for xen-devel@lists.xenproject.org; Tue, 02 Feb 2016 06:19:54 +0000 Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id 92/A3-28221-98A40B65; Tue, 02 Feb 2016 06:19:53 +0000 X-Env-Sender: dongli.zhang@oracle.com X-Msg-Ref: server-2.tower-27.messagelabs.com!1454393991!18763159!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 38122 invoked from network); 2 Feb 2016 06:19:52 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-2.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 Feb 2016 06:19:52 -0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u126JnnP011380 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 Feb 2016 06:19:50 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u126Jmt6018981 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 2 Feb 2016 06:19:49 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u126JmJG011995; Tue, 2 Feb 2016 06:19:48 GMT Received: from [10.182.38.10] (/10.182.38.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Feb 2016 22:19:47 -0800 Message-ID: <1454394031.2873.10.camel@linux> From: Dongli Zhang To: ian.campbell@citrix.com Date: Tue, 02 Feb 2016 14:20:31 +0800 X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Mailman-Approved-At: Tue, 02 Feb 2016 06:51:16 +0000 Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: [Xen-devel] [PATCH 1/1] xen-netfront: uninitialized fields in xenvif_rx_action X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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, };