public inbox for linux-safety@lists.elisa.tech
 help / color / mirror / Atom feed
* [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
@ 2021-11-03 23:27 Nghia Le
  2021-11-03 23:27 ` [linux-safety] " Nghia Le
  2021-11-04  6:50 ` Lukas Bulwahn
  0 siblings, 2 replies; 6+ messages in thread
From: Nghia Le @ 2021-11-03 23:27 UTC (permalink / raw)
  To: linux-safety, lukas.bulwahn; +Cc: Nghia Le

The newinet value is initialized with inet_sk() in a block code starting
from checking condition of protocol to exiting by returning newsk
structure. Along the code path, newinet is never read. Thus, assignment
to newinet is wredundant and can be removed.

Signed-off-by: Nghia Le <nghialm78@gmail.com>
---
 net/ipv6/tcp_ipv6.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 2cc9b0e53ad1..551fce49841d 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1263,7 +1263,6 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
 
 		inet_sk(newsk)->pinet6 = tcp_inet6_sk(newsk);
 
-		newinet = inet_sk(newsk);
 		newnp = tcp_inet6_sk(newsk);
 		newtp = tcp_sk(newsk);
 
-- 
2.25.1



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

end of thread, other threads:[~2021-11-04 14:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-03 23:27 [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock() Nghia Le
2021-11-03 23:27 ` [linux-safety] " Nghia Le
2021-11-04  6:50 ` Lukas Bulwahn
2021-11-04  6:50   ` [linux-safety] " Lukas Bulwahn
2021-11-04 14:42   ` Nghia Le
2021-11-04 14:42     ` [linux-safety] " Nghia Le

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox