From 7fd92ba31ac1c688b59aa93cc03b748f920df8fe Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 8 May 2024 06:15:07 +0200 Subject: Adding upstream version 4.19.282. Signed-off-by: Daniel Baumann --- net/x25/af_x25.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'net/x25/af_x25.c') diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 77d8adb27..9d0328bb3 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -497,6 +497,12 @@ static int x25_listen(struct socket *sock, int backlog) int rc = -EOPNOTSUPP; lock_sock(sk); + if (sock->state != SS_UNCONNECTED) { + rc = -EINVAL; + release_sock(sk); + return rc; + } + if (sk->sk_state != TCP_LISTEN) { memset(&x25_sk(sk)->dest_addr, 0, X25_ADDR_LEN); sk->sk_max_ack_backlog = backlog; -- cgit v1.2.3