Skip to contentSkip to conversation

rds: send: Fix dead code in rds_sendmsg

PATCH Applied Gustavo A. R. Silva 4 participants 4 messages Jul 25, 2018 – Jul 26, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rds: send: Fix dead code in rds_sendmsg

Currently, code at label *out* is unreachable. Fix this by updating variable *ret* with -EINVAL, so the jump to *out* can be properly executed instead of directly returning from function.

Addresses-Coverity-ID: 1472059 ("Structurally dead code")

Fixes 1e2b44e78eea ("rds: Enable RDS IPv6 support")
---
 net/rds/send.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/rds/send.c +1 -1
index 9604e1f..18e2b4d 100644
@@ -1126,7 +1126,7 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
 				if (addr4 == htonl(INADDR_ANY) ||
 				    addr4 == htonl(INADDR_BROADCAST) ||
 				    IN_MULTICAST(ntohl(addr4))) {
-					return -EINVAL;
+					ret = -EINVAL;
 					goto out;
 				}
 			}
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Gustavo A. R. Silva

Currently, code at label *out* is unreachable. Fix this by updating variable *ret* with -EINVAL, so the jump to *out* can be properly executed instead of directly returning from function.

Addresses-Coverity-ID: 1472059 ("Structurally dead code")

Fixes 1e2b44e78eea ("rds: Enable RDS IPv6 support")
Acked-by on v1 1/1
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 8 lines · Gustavo A. R. Silva

Currently, code at label *out* is unreachable. Fix this by updating variable *ret* with -EINVAL, so the jump to *out* can be properly executed instead of directly returning from function.

Addresses-Coverity-ID: 1472059 ("Structurally dead code")

Fixes 1e2b44e78eea ("rds: Enable RDS IPv6 support")

---

Looks fine.

maintainer Applied
#3 lore raw
In reply to Gustavo A. R. Silva

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 25 Jul 2018 10:22:27 -0500

Quoted 7 lines

Currently, code at label *out* is unreachable. Fix this by updating variable *ret* with -EINVAL, so the jump to *out* can be properly executed instead of directly returning from function.

Addresses-Coverity-ID: 1472059 ("Structurally dead code")

Fixes 1e2b44e78eea ("rds: Enable RDS IPv6 support")

Applied.