* [PATCH] rds: send: Fix dead code in rds_sendmsg
@ 2018-07-25 15:22 Gustavo A. R. Silva
2018-07-25 15:27 ` Sowmini Varadhan
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-25 15:22 UTC (permalink / raw)
To: Ka-Cheong Poon, Santosh Shilimkar, David S. Miller
Cc: netdev, linux-rdma, rds-devel, linux-kernel, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
net/rds/send.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/rds/send.c b/net/rds/send.c
index 9604e1f..18e2b4d 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -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;
}
}
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rds: send: Fix dead code in rds_sendmsg
2018-07-25 15:22 [PATCH] rds: send: Fix dead code in rds_sendmsg Gustavo A. R. Silva
@ 2018-07-25 15:27 ` Sowmini Varadhan
2018-07-25 16:52 ` Santosh Shilimkar
2018-07-26 5:38 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Sowmini Varadhan @ 2018-07-25 15:27 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Ka-Cheong Poon, Santosh Shilimkar, David S. Miller, netdev,
linux-rdma, rds-devel, linux-kernel
On (07/25/18 10:22), Gustavo A. R. Silva wrote:
> 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")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rds: send: Fix dead code in rds_sendmsg
2018-07-25 15:22 [PATCH] rds: send: Fix dead code in rds_sendmsg Gustavo A. R. Silva
2018-07-25 15:27 ` Sowmini Varadhan
@ 2018-07-25 16:52 ` Santosh Shilimkar
2018-07-26 5:38 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Santosh Shilimkar @ 2018-07-25 16:52 UTC (permalink / raw)
To: Gustavo A. R. Silva, Ka-Cheong Poon, David S. Miller
Cc: netdev, linux-rdma, rds-devel, linux-kernel
On 7/25/2018 8:22 AM, Gustavo A. R. Silva wrote:
> 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")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
Looks fine.
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rds: send: Fix dead code in rds_sendmsg
2018-07-25 15:22 [PATCH] rds: send: Fix dead code in rds_sendmsg Gustavo A. R. Silva
2018-07-25 15:27 ` Sowmini Varadhan
2018-07-25 16:52 ` Santosh Shilimkar
@ 2018-07-26 5:38 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-07-26 5:38 UTC (permalink / raw)
To: gustavo
Cc: ka-cheong.poon, santosh.shilimkar, netdev, linux-rdma, rds-devel,
linux-kernel
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Wed, 25 Jul 2018 10:22:27 -0500
> 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")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-26 5:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-25 15:22 [PATCH] rds: send: Fix dead code in rds_sendmsg Gustavo A. R. Silva
2018-07-25 15:27 ` Sowmini Varadhan
2018-07-25 16:52 ` Santosh Shilimkar
2018-07-26 5:38 ` David Miller
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).