netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Patrick McHardy <kaber@trash.net>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
	"David S. Miller" <davem@davemloft.net>,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] netfilter: nf_tables: avoid uninitialized variable warning
Date: Fri, 30 Sep 2016 20:21:29 +0200	[thread overview]
Message-ID: <20160930182006.GA1767@salvia> (raw)
In-Reply-To: <20160930174749.GF1176@salvia>

On Fri, Sep 30, 2016 at 07:47:49PM +0200, Pablo Neira Ayuso wrote:
> On Fri, Sep 30, 2016 at 06:05:34PM +0200, Arnd Bergmann wrote:
> > The newly added nft_range_eval() function handles the two possible
> > nft range operations, but as the compiler warning points out,
> > any unexpected value would lead to the 'mismatch' variable being
> > used without being initialized:
> > 
> > net/netfilter/nft_range.c: In function 'nft_range_eval':
> > net/netfilter/nft_range.c:45:5: error: 'mismatch' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > 
> > This can be trivially avoided by added a 'default:' clause.
> 
> Applied this patch, I took Aaron's and Pai's patches instead.

Looking at this again, I know uninitialized_var() has been discussed
as not nice since it can hide bugs behind. But if I fix the existing
code to validate priv->op from _init() (this is currently broken), we
can probably use this so save extra code in the packet path for a case
that is not going to happen.

Let me know, thanks!

      reply	other threads:[~2016-09-30 18:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-30 16:05 [PATCH 1/3] netfilter: nf_tables: avoid uninitialized variable warning Arnd Bergmann
2016-09-30 16:05 ` [PATCH 2/3] netfilter: hide reference to nf_hooks_ingress Arnd Bergmann
2016-09-30 17:06   ` Aaron Conole
2016-09-30 16:05 ` [PATCH 3/3] netfilter: xt_hashlimit: uses div_u64 for division Arnd Bergmann
2016-09-30 16:38   ` Eric Dumazet
2016-09-30 17:21     ` Vishwanath Pai
2016-09-30 17:39     ` Arnd Bergmann
2016-09-30 17:47 ` [PATCH 1/3] netfilter: nf_tables: avoid uninitialized variable warning Pablo Neira Ayuso
2016-09-30 18:21   ` Pablo Neira Ayuso [this message]

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=20160930182006.GA1767@salvia \
    --to=pablo@netfilter.org \
    --cc=arnd@arndb.de \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.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).