Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7045967rwb; Mon, 5 Dec 2022 23:47:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf57ecEHU/vvLpUpbgZGqWSqSszbke0ea04qKnlo5u9m2nkxIK1kKxTY+i38I46pEDpR1If9 X-Received: by 2002:a05:6a00:4c8f:b0:575:4bb2:d67d with SMTP id eb15-20020a056a004c8f00b005754bb2d67dmr38796488pfb.32.1670312856630; Mon, 05 Dec 2022 23:47:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670312856; cv=none; d=google.com; s=arc-20160816; b=IIn/q9yORkemGKH213EeZ9vlPvGy/rgXxrVOqwoOsWL30z3bYeGescQU+ewXeY+ovD 9L6vhekuEZb8iWWqCXg1FxE64R/wQJtMjOHDsBtkRiZZWI5ERSTxJy9woaCy0HvWmxQv SM2dNbzGzAnyzQlCqU4OwHhxH5qMFgFnc5vIxW6UmvX0lfcL7ZH+ffxen2T7F6DgvSy4 vrIrtFw7zjsA0pM5a/noZPueEW4qYfQMNB4CyXktkjBmGpocYubhcUnVsN7YftmJvH1P t41tvTcWp1FvstGc+gzHDA9/bPwwRqXon5I2Fp+UIfXk6Fgt/Htr746Ae0aeyv6c8BOG WWOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=ZuynJbwHxwMvApedRcwv1kC/hjfAoOswZ8+NvGiaPwI=; b=pVScrchtJur4HaDbuLsDObbRvqkq1MyR1f8tsuh7r8icEDOWG9uoZkuCa+O90MYwM8 +4KkuZmYb0hGGRC7W+80IDqzcId628naIcSG6sxCNPooRUDwkXj5WW5bmbAFPWxZ0ssZ Pl/rr+c9MgHVT/G4aa2fdLvnXAiFQMuz0yLP/O8CQWa19yMsMIF7fDPbMFD47n2AFRVX xjeuafmhzijirUq+0fcrlHlczFCpyp02dWBbuec5IMoUpWuG19piOcfpCi7oxVE9PD4Z 0LSXG4SqArkChOy6hfQP3AWhHjlM9SaaNtU290n1wIBkoVlUq+TPlUusVwd2sLfQe3ah pwiA== 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 i18-20020a170902cf1200b00189772559afsi16525384plg.191.2022.12.05.23.47.26; Mon, 05 Dec 2022 23:47:36 -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 S231434AbiLFHpg (ORCPT + 79 others); Tue, 6 Dec 2022 02:45:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbiLFHpa (ORCPT ); Tue, 6 Dec 2022 02:45:30 -0500 Received: from mail.nfschina.com (unknown [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2BBEA11C14; Mon, 5 Dec 2022 23:45:28 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 9B1DB1E80D0E; Tue, 6 Dec 2022 15:41:10 +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 67sWBfMGm1OG; Tue, 6 Dec 2022 15:41:08 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 64DCD1E80D57; Tue, 6 Dec 2022 15:41:07 +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 v2] netfilter: add a 'default' case to 'switch (tuplehash->tuple.xmit_type)' Date: Tue, 6 Dec 2022 15:44:14 +0800 Message-Id: <20221206074414.12208-1-liqiong@nfschina.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20221202070331.10865-1-liqiong@nfschina.com> References: <20221202070331.10865-1-liqiong@nfschina.com> 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 Add a 'default' case in case return a uninitialized value of ret. Signed-off-by: Li Qiong --- v2: Add 'default' case instead of initializing 'ret'. --- net/netfilter/nf_flow_table_ip.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c index b350fe9d00b0..19efba1e51ef 100644 --- a/net/netfilter/nf_flow_table_ip.c +++ b/net/netfilter/nf_flow_table_ip.c @@ -421,6 +421,10 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb, if (ret == NF_DROP) flow_offload_teardown(flow); break; + default: + WARN_ON_ONCE(1); + ret = NF_DROP; + break; } return ret; @@ -682,6 +686,10 @@ nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb, if (ret == NF_DROP) flow_offload_teardown(flow); break; + default: + WARN_ON_ONCE(1); + ret = NF_DROP; + break; } return ret; -- 2.11.0