diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 208da9a9909c..37ff6766fd52 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3753,6 +3753,11 @@ static int mptcp_listen(struct socket *sock, int backlog) pr_debug("msk=%p", msk); lock_sock(sk); + + err = -EINVAL; + if (sock->state != SS_UNCONNECTED || sock->type != SOCK_STREAM) + goto unlock; + ssock = __mptcp_nmpc_socket(msk); if (!ssock) { err = -EINVAL;