Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1721110rwb; Thu, 1 Dec 2022 23:33:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf7zRJM5c7v18HFFpSZPEuOW27VER63bqlwi3NFgW4gEiREpfuDmuMF6JWDVP8tjX3IEpCDm X-Received: by 2002:a17:907:6daa:b0:7ba:e537:c64b with SMTP id sb42-20020a1709076daa00b007bae537c64bmr37145380ejc.180.1669966391033; Thu, 01 Dec 2022 23:33:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669966391; cv=none; d=google.com; s=arc-20160816; b=CEhtku71rb5KTPwQnuEEG0+7Cng/++N5pMG91gSBFEB55Rdvvgqh3QOL7c5lfW9jzg /NmVzwr/8pnJygQEpXEmR2Yi9ZwRo5V+0AZEdiVoVX13SVhDsZVQv1IjGPZy28vxJ0wd VXvr3pQ1ERBv9L4nIiSh7/gngFJ9jgC6SJ+NiK5V5piBnzaxu5xCn72zoQTignscjXYS 0BysAbSZFuWrMw8TMiNHvYiYjMIEocTX05HG1UXz0Pp6TqygE0qpx/6rMjfGbTLtd/44 TXyro306uyy5BynqAo5SFg4/niQcndI2K6SwNDHhV7MQ8cr86HF6w1q00dNlmA1tm/o1 yZOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=AGmeZbkSFYAuka6oSmj+lzbCecwsxsqpJWbmmqsbUgs=; b=qgjainhJ/suvZSmSs/Q7BWbN+tlpuZWa5IYMLEmk19s9FRC7btyWBTe2dUgSzNgfG7 XO8eHvkTsiogGxBZoJBFnFixk2nnF6JftWZJY17r91N8VVztXQPXx+HJYSJ8s0ewUbpg LiORneNEow68/m97aZ3Oq3FmU7RPdgwLMbyepp4r+LF88oA/3nSBPQ2Vb4yzAAfqXy/W sWEwOHVKPFJ5RWe9QmEaZqantUp99BcefOPZTCkMwtrLhWzLtVhnI4De7L095rLRvKrw rotPR5xpX9S4UFjdl8WAot7uuNWloASILyi/ZsyUZ/P/NmgHlt8CfdUO4alGsUSH5FKH OKOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he13-20020a1709073d8d00b007c0be5e871dsi1878204ejc.663.2022.12.01.23.32.46; Thu, 01 Dec 2022 23:33:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232484AbiLBHEl (ORCPT + 83 others); Fri, 2 Dec 2022 02:04:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230163AbiLBHEj (ORCPT ); Fri, 2 Dec 2022 02:04:39 -0500 Received: from mail.nfschina.com (unknown [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1DE7DBEE36; Thu, 1 Dec 2022 23:04:37 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 439C01E80D27; Fri, 2 Dec 2022 15:00:33 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Si2qrSyBFN9Z; Fri, 2 Dec 2022 15:00:30 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id CDC741E80CCF; Fri, 2 Dec 2022 15:00:29 +0800 (CST) From: Li Qiong To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, kernel-janitors@vger.kernel.org, coreteam@netfilter.org, Yu Zhe , Li Qiong Subject: [PATCH] netfilter: initialize 'ret' variable Date: Fri, 2 Dec 2022 15:03:31 +0800 Message-Id: <20221202070331.10865-1-liqiong@nfschina.com> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 'ret' should need to be initialized to 0, in case return a uninitialized value. Signed-off-by: Li Qiong --- net/netfilter/nf_flow_table_ip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c index b350fe9d00b0..225ff865d609 100644 --- a/net/netfilter/nf_flow_table_ip.c +++ b/net/netfilter/nf_flow_table_ip.c @@ -351,7 +351,7 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb, struct rtable *rt; struct iphdr *iph; __be32 nexthop; - int ret; + int ret = 0; if (skb->protocol != htons(ETH_P_IP) && !nf_flow_skb_encap_protocol(skb, htons(ETH_P_IP), &offset)) @@ -613,7 +613,7 @@ nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb, u32 hdrsize, offset = 0; struct ipv6hdr *ip6h; struct rt6_info *rt; - int ret; + int ret = 0; if (skb->protocol != htons(ETH_P_IPV6) && !nf_flow_skb_encap_protocol(skb, htons(ETH_P_IPV6), &offset)) -- 2.11.0