All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nghia Le <nghialm78@gmail.com>
To: linux-safety@lists.elisa.tech, lukas.bulwahn@gmail.com
Cc: Nghia Le <nghialm78@gmail.com>
Subject: [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
Date: Thu,  4 Nov 2021 06:27:22 +0700	[thread overview]
Message-ID: <20211103232722.30999-1-nghialm78@gmail.com> (raw)

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



WARNING: multiple messages have this Message-ID (diff)
From: "Nghia Le" <nghialm78@gmail.com>
To: linux-safety@lists.elisa.tech, lukas.bulwahn@gmail.com
Cc: Nghia Le <nghialm78@gmail.com>
Subject: [linux-safety] [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock()
Date: Thu,  4 Nov 2021 06:27:22 +0700	[thread overview]
Message-ID: <20211103232722.30999-1-nghialm78@gmail.com> (raw)
Message-ID: <20211103232722.rWvvanakj0byG7NJOVN18fHkWZHSx2_TVcpPKWmiYHw@z> (raw)

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



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#261): https://lists.elisa.tech/g/linux-safety/message/261
Mute This Topic: https://lists.elisa.tech/mt/86805127/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



             reply	other threads:[~2021-11-03 23:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 23:27 Nghia Le [this message]
2021-11-03 23:27 ` [linux-safety] [PATCH] ipv6: remove useless assignment to newinet in tcp_v6_syn_recv_sock() 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
2021-11-04 14:37 Nghia Le
2021-11-04 16:44 ` Eric Dumazet
2021-11-06  3:00 ` patchwork-bot+netdevbpf
2021-11-06  8:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211103232722.30999-1-nghialm78@gmail.com \
    --to=nghialm78@gmail.com \
    --cc=linux-safety@lists.elisa.tech \
    --cc=lukas.bulwahn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.