Skip to content

Commit 52e86eb

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
mptcp: sockopt: drop redundant tcp_getsockopt
tcp_getsockopt() is called twice in mptcp_getsockopt_first_sf_only(), which makes the code a bit redundant. The first call to tcp_getsockopt() when the first subflow exists can be replaced by going to a new label "get" before the second call. Signed-off-by: Geliang Tang <[email protected]>
1 parent 4cf2cf4 commit 52e86eb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

net/mptcp/sockopt.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -914,17 +914,16 @@ static int mptcp_getsockopt_first_sf_only(struct mptcp_sock *msk, int level, int
914914

915915
lock_sock(sk);
916916
ssk = msk->first;
917-
if (ssk) {
918-
ret = tcp_getsockopt(ssk, level, optname, optval, optlen);
919-
goto out;
920-
}
917+
if (ssk)
918+
goto get;
921919

922920
ssk = __mptcp_nmpc_sk(msk);
923921
if (IS_ERR(ssk)) {
924922
ret = PTR_ERR(ssk);
925923
goto out;
926924
}
927925

926+
get:
928927
ret = tcp_getsockopt(ssk, level, optname, optval, optlen);
929928

930929
out:

0 commit comments

Comments
 (0)