mptcp: avoid unneeded __mptcp_nmpc_socket() usage
authorPaolo Abeni <pabeni@redhat.com>
Fri, 14 Apr 2023 14:08:01 +0000 (16:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:05 +0000 (10:34 +0200)
commitc5ebb5cec9fb9528c72ece3140a377bd22e19ccf
tree925ed903424a29f988b7fde27ca6277fcd2d889a
parentea9d7382d5d3cbb733b71cad829a4299bc348b2d
mptcp: avoid unneeded __mptcp_nmpc_socket() usage

[ Upstream commit 617612316953093bc859890e405e1b550c27d840 ]

In a few spots, the mptcp code invokes the __mptcp_nmpc_socket() helper
multiple times under the same socket lock scope. Additionally, in such
places, the socket status ensures that there is no MP capable handshake
running.

Under the above condition we can replace the later __mptcp_nmpc_socket()
helper invocation with direct access to the msk->subflow pointer and
better document such access is not supposed to fail with WARN().

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: 5b825727d087 ("mptcp: add annotations around msk->subflow accesses")
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mptcp/protocol.c