]> git.itanic.dy.fi Git - linux-stable/commitdiff
netfilter: nfnetlink_log: silence bogus compiler warning
authorFlorian Westphal <fw@strlen.de>
Thu, 5 Oct 2023 08:53:08 +0000 (10:53 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 12 Oct 2023 08:28:45 +0000 (10:28 +0200)
net/netfilter/nfnetlink_log.c:800:18: warning: variable 'ctinfo' is uninitialized

The warning is bogus, the variable is only used if ct is non-NULL and
always initialised in that case.  Init to 0 too to silence this.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309100514.ndBFebXN-lkp@intel.com/
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nfnetlink_log.c

index 53c9e76473ba17713871c7f60c19acc18c8b72d7..f03f4d4d7d88967d237c5064cd729ea6f83b40bf 100644 (file)
@@ -698,8 +698,8 @@ nfulnl_log_packet(struct net *net,
        unsigned int plen = 0;
        struct nfnl_log_net *log = nfnl_log_pernet(net);
        const struct nfnl_ct_hook *nfnl_ct = NULL;
+       enum ip_conntrack_info ctinfo = 0;
        struct nf_conn *ct = NULL;
-       enum ip_conntrack_info ctinfo;
 
        if (li_user && li_user->type == NF_LOG_TYPE_ULOG)
                li = li_user;