From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH] [rfc, netfilter-next] netfilter: nf_tables: fib warnings Date: Fri, 28 Oct 2016 18:15:01 +0200 Message-ID: <18995804.9DSMHNUO14@wuerfel> References: <20161028153124.3773180-1-arnd@arndb.de> <20161028155031.GI23011@breakpoint.cc> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Cc: Pablo Neira Ayuso , Patrick McHardy , Jozsef Kadlecsik , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Florian Westphal Return-path: In-Reply-To: <20161028155031.GI23011@breakpoint.cc> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Friday, October 28, 2016 5:50:31 PM CEST Florian Westphal wrote: > Arnd Bergmann wrote: > > The newly added nft fib code produces two warnings: > > > > net/ipv4/netfilter/nft_fib_ipv4.c: In function 'nft_fib4_eval': > > net/ipv4/netfilter/nft_fib_ipv4.c:80:6: error: unused variable 'i' [-Werror=unused-variable] > > net/ipv4/netfilter/nft_fib_ipv4.c: In function ‘nft_fib4_eval’: > > net/ipv4/netfilter/nft_fib_ipv4.c:137:6: error: ‘oif’ may be used uninitialized in this function [-Werror=maybe-uninitialized] > > > > The first one is obvious as the only user of that variable is > > inside of an #ifdef, but the second one is a bit trickier. > > It is clear that 'oif' is uninitialized here if neither > > NFTA_FIB_F_OIF nor NFTA_FIB_F_IIF are set. > > > > I have no idea how that should be handled, this patch just > > returns without doing anything, which may or may not be > > the right thing to do. > > It should be initialized to NULL. Ok, I had considered that, but wasn't sure if ->nh_dev could ever be NULL, as that would then get dereferenced. Arnd