netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kbuild test robot <fengguang.wu@intel.com>
Subject: [PATCH nf-next] netfilter: nf_tables: silence gcc warning with stateful object maps
Date: Tue,  6 Dec 2016 13:29:41 +0100	[thread overview]
Message-ID: <1481027381-3934-1-git-send-email-pablo@netfilter.org> (raw)

Not a problem in practise since objtype is ignored if the NFT_SET_OBJECT
flag is not set.

But call down gcc warnings:

   net/netfilter/nf_tables_api.c: In function 'nf_tables_newset':
>> net/netfilter/nf_tables_api.c:3003:15: warning: 'objtype' may be used
+uninitialized in this function

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_tables_api.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 799eaa6808b9..789229663028 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2920,6 +2920,8 @@ static int nf_tables_newset(struct net *net, struct sock *nlsk,
 			return -EINVAL;
 	} else if (flags & NFT_SET_OBJECT)
 		return -EINVAL;
+	else
+		objtype = NFT_OBJ_UNSPEC;
 
 	timeout = 0;
 	if (nla[NFTA_SET_TIMEOUT] != NULL) {
-- 
2.1.4


             reply	other threads:[~2016-12-06 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06 12:29 Pablo Neira Ayuso [this message]
2016-12-06 19:59 ` [PATCH nf-next] netfilter: nf_tables: silence gcc warning with stateful object maps kbuild test robot

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=1481027381-3934-1-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=fengguang.wu@intel.com \
    --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).