[PATCH 11/36] ipvs: remove conditional return with no effect
From: Sang-Heon Jeon <hidden>
Date: 2026-07-23 18:46:29
Also in:
cocci, lkml, lvs-devel, netfilter-devel
Subsystem:
ipvs, netfilter, networking [general], the rest · Maintainers:
Simon Horman, Julian Anastasov, Pablo Neira Ayuso, Florian Westphal, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.
Signed-off-by: Sang-Heon Jeon <redacted>
---
net/netfilter/ipvs/ip_vs_sync.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 93038abbf5e0..bd4f7e906cf7 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1603,15 +1603,10 @@ ip_vs_receive(struct socket *sock, char *buffer, const size_t buflen)
{
struct msghdr msg = {NULL,};
struct kvec iov = {buffer, buflen};
- int len;
/* Receive a packet */
iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, buflen);
- len = sock_recvmsg(sock, &msg, MSG_DONTWAIT);
- if (len < 0)
- return len;
-
- return len;
+ return sock_recvmsg(sock, &msg, MSG_DONTWAIT);
}
/* Wakeup the master thread for sending */--
2.43.0