netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf-next,v2] netfilter: nf_tables: silence gcc warning with stateful object maps
@ 2016-12-06 12:30 Pablo Neira Ayuso
  0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2016-12-06 12:30 UTC (permalink / raw)
  To: netfilter-devel; +Cc: kbuild test robot

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

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
v2: should be NFT_OBJECT_UNSPEC, not NFT_OBJ_UNSPEC

 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..9ead6a7514c3 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_OBJECT_UNSPEC;
 
 	timeout = 0;
 	if (nla[NFTA_SET_TIMEOUT] != NULL) {
-- 
2.1.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-06 12:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 12:30 [PATCH nf-next,v2] netfilter: nf_tables: silence gcc warning with stateful object maps Pablo Neira Ayuso

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).