From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752776AbcEIUBg (ORCPT ); Mon, 9 May 2016 16:01:36 -0400 Received: from mail.us.es ([193.147.175.20]:54472 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642AbcEIUBe (ORCPT ); Mon, 9 May 2016 16:01:34 -0400 Date: Mon, 9 May 2016 22:01:17 +0200 From: Pablo Neira Ayuso To: Arnd Bergmann Cc: Patrick McHardy , Jozsef Kadlecsik , "David S. Miller" , Florian Westphal , Daniel Borkmann , Sasha Levin , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netfilter: conntrack: remove uninitialized shadow variable Message-ID: <20160509200117.GA6957@salvia> References: <1462823254-3137116-1-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462823254-3137116-1-git-send-email-arnd@arndb.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 09, 2016 at 09:47:23PM +0200, Arnd Bergmann wrote: > A recent commit introduced an unconditional use of an uninitialized > variable, as reported in this gcc warning: > > net/netfilter/nf_conntrack_core.c: In function '__nf_conntrack_confirm': > net/netfilter/nf_conntrack_core.c:632:33: error: 'ctinfo' may be used uninitialized in this function [-Werror=maybe-uninitialized] > bytes = atomic64_read(&counter[CTINFO2DIR(ctinfo)].bytes); > ^ > net/netfilter/nf_conntrack_core.c:628:26: note: 'ctinfo' was declared here > enum ip_conntrack_info ctinfo; > > The problem is that a local variable shadows the function parameter. > This removes the local variable, which looks like what Pablo originally > intended. Acked-by: Pablo Neira Ayuso Sorry for this, I wonder why gcc didn't catch up this here. @David, you can integrate this into your net-next tree. Thanks for fixing up this Arnd.