netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipvs: initialize 'ret' variable in do_ip_vs_set_ctl()
@ 2022-12-02  3:25 Li Qiong
  2022-12-02 10:02 ` Simon Horman
  2022-12-02 10:07 ` Dan Carpenter
  0 siblings, 2 replies; 10+ messages in thread
From: Li Qiong @ 2022-12-02  3:25 UTC (permalink / raw)
  To: Simon Horman, Julian Anastasov, Pablo Neira Ayuso,
	Jozsef Kadlecsik, Florian Westphal, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, lvs-devel, netfilter-devel, kernel-janitors,
	coreteam, Yu Zhe, Li Qiong

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 <liqiong@nfschina.com>
---
 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-13 11:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-02  3:25 [PATCH] ipvs: initialize 'ret' variable in do_ip_vs_set_ctl() Li Qiong
2022-12-02 10:02 ` Simon Horman
2022-12-02 10:07 ` Dan Carpenter
2022-12-02 10:18   ` liqiong
2022-12-02 10:26     ` Dan Carpenter
2022-12-02 11:26       ` Julian Anastasov
2022-12-12  7:05         ` liqiong
2022-12-12  7:43           ` [PATCH v2] ipvs: add a 'default' case " Li Qiong
2022-12-12 14:20             ` Julian Anastasov
2022-12-13 11:28               ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).