projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5fb45f9
)
ipvs: add a 'default' case in do_ip_vs_set_ctl()
author
Li Qiong
<liqiong@nfschina.com>
Mon, 12 Dec 2022 07:43:51 +0000
(15:43 +0800)
committer
Pablo Neira Ayuso
<pablo@netfilter.org>
Tue, 13 Dec 2022 11:23:18 +0000
(12:23 +0100)
It is better to return the default switch case with
'-EINVAL', in case new commands are added. otherwise,
return a uninitialized value of ret.
Signed-off-by: Li Qiong <liqiong@nfschina.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipvs/ip_vs_ctl.c
patch
|
blob
|
blame
|
history
diff --git
a/net/netfilter/ipvs/ip_vs_ctl.c
b/net/netfilter/ipvs/ip_vs_ctl.c
index 988222fff9f025a6635b66e47ad518e67e34c182..97f6a1c8933acd99b786c61fe02aba516ab69e72 100644
(file)
--- a/
net/netfilter/ipvs/ip_vs_ctl.c
+++ b/
net/netfilter/ipvs/ip_vs_ctl.c
@@
-2590,6
+2590,11
@@
do_ip_vs_set_ctl(struct sock *sk, int cmd, sockptr_t ptr, unsigned int len)
break;
case IP_VS_SO_SET_DELDEST:
ret = ip_vs_del_dest(svc, &udest);
+ break;
+ default:
+ WARN_ON_ONCE(1);
+ ret = -EINVAL;
+ break;
}
out_unlock: