From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo Neira Ayuso Subject: [PATCH nf-next,v2] netfilter: nf_tables: silence gcc warning with stateful object maps Date: Tue, 6 Dec 2016 13:30:50 +0100 Message-ID: <1481027450-5111-1-git-send-email-pablo@netfilter.org> Cc: kbuild test robot To: netfilter-devel@vger.kernel.org Return-path: Received: from mail.us.es ([193.147.175.20]:53584 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752118AbcLFMbM (ORCPT ); Tue, 6 Dec 2016 07:31:12 -0500 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id A20F48CD95 for ; Tue, 6 Dec 2016 13:30:55 +0100 (CET) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 94BFEDA849 for ; Tue, 6 Dec 2016 13:30:55 +0100 (CET) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 981A6DA85D for ; Tue, 6 Dec 2016 13:30:53 +0100 (CET) Sender: netfilter-devel-owner@vger.kernel.org List-ID: 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 Signed-off-by: Pablo Neira Ayuso --- 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