From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754571AbcBBK0H (ORCPT ); Tue, 2 Feb 2016 05:26:07 -0500 Received: from smtp.citrix.com ([66.165.176.89]:32163 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754494AbcBBK0G (ORCPT ); Tue, 2 Feb 2016 05:26:06 -0500 X-IronPort-AV: E=Sophos;i="5.22,384,1449532800"; d="scan'208";a="329105931" Subject: Re: [Xen-devel] [PATCH 1/1] xen-netfront: uninitialized fields in xenvif_rx_action To: Dongli Zhang , References: <1454394031.2873.10.camel@linux> CC: , From: David Vrabel Message-ID: <56B08421.5000302@citrix.com> Date: Tue, 2 Feb 2016 10:25:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <1454394031.2873.10.camel@linux> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, > }; >