Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1555309rwb; Thu, 1 Dec 2022 20:12:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf6/qS8KFvvsqBx8aMoa4G8t/Pn8nstZywjf3LmwdXDxmQe2BzKVuMa96rRYLfryZpL/yoJk X-Received: by 2002:a17:906:a0d9:b0:78d:b912:6a6c with SMTP id bh25-20020a170906a0d900b0078db9126a6cmr59704144ejb.124.1669954325961; Thu, 01 Dec 2022 20:12:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669954325; cv=none; d=google.com; s=arc-20160816; b=DwkHebMHGMIhIApnV+L5cZpifwJ4A952pbLOZvoMT0CcUQbzS6AFRq6c3Wv8bzB4Ct 35H1NJI3B27rNI8jfBR8he5dm0amMRyQD4Ow3SEoO4zZFZFI1x6R8tNcP662CkQPjqWq VKSW93JmObvSMc2bd9BoD+V876zqX/IStdzhaJlyHoeypiUq9BaqfP1+uPjZA9De5wZ2 IwyKvEOxuq5fN87xUSwXdqf3uDzR8woWOAAQ/C2E7q7Hz6OeGoLkMAi8GMyxVSXbqIOE noMAaCv9DO+WVd5G9lhYUUPL8AcCHcSKxBhlkx2LnQq4BwANnH/GMSuCeoxGvQwZkw8L gjrA== 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=EWd/OHTHzA1j/2juwwJJsXTt5++dOg7oZNPq3yzRIxc=; b=teBDxsgFjwxcIB9s6yQWEYa0ZSAdPSaqwVD3ET3k+hZw8E68rnEt//+9myi+IJmYi8 5ZabPJViDIXPgY1m5LXur0BUds04/QCkEYtRMR0goCt6BrHLnA73MR+jbrMAdOk026Uk aYo1jRqJ9Kw4OVhTI9ZfwA8BUCRNmMCPBd+9hN7G9+7cN5ZjulvsOoDsLJeScckWTny4 EOUlsVxihWktgEnhlSOIEbBLRO7QfvvM6UCWiprPKpIqfG9gcC2zVeyY7OcZNh8HAVCS xfVthnOalJcsK+uFxkxFnZRjOoXB0I0RH+HMVHCwKsczjxZEAj9DXCEgFjYL6b+DjnDy ZySA== 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 ae14-20020a17090725ce00b007ae1d040bffsi5291745ejc.223.2022.12.01.20.11.46; Thu, 01 Dec 2022 20:12:05 -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 S231839AbiLBD0P (ORCPT + 81 others); Thu, 1 Dec 2022 22:26:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231181AbiLBD0M (ORCPT ); Thu, 1 Dec 2022 22:26:12 -0500 Received: from mail.nfschina.com (mail.nfschina.com [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 29AE4D78FE; Thu, 1 Dec 2022 19:26:11 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 8B9FB1E80D50; Fri, 2 Dec 2022 11:22:06 +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 4sj_UncHBgSW; Fri, 2 Dec 2022 11:22:03 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 0411A1E80D27; Fri, 2 Dec 2022 11:22:02 +0800 (CST) From: Li Qiong To: Simon Horman , Julian Anastasov , 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, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, kernel-janitors@vger.kernel.org, coreteam@netfilter.org, Yu Zhe , Li Qiong Subject: [PATCH] ipvs: initialize 'ret' variable in do_ip_vs_set_ctl() Date: Fri, 2 Dec 2022 11:25:11 +0800 Message-Id: <20221202032511.1435-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 because no default process for "switch (cmd)". Signed-off-by: Li Qiong --- net/netfilter/ipvs/ip_vs_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 988222fff9f0..4b20db86077c 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -2456,7 +2456,7 @@ static int do_ip_vs_set_ctl(struct sock *sk, int cmd, sockptr_t ptr, unsigned int len) { struct net *net = sock_net(sk); - int ret; + int ret = 0; unsigned char arg[MAX_SET_ARGLEN]; struct ip_vs_service_user *usvc_compat; struct ip_vs_service_user_kern usvc; -- 2.11.0