summaryrefslogtreecommitdiffstats
path: root/net/netrom/af_netrom.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-06 10:48:49 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-06 10:48:49 +0100
commitf6b2ce79b5fbbb330f56262f0f4373d6af60b602 (patch)
tree1228dd9989b03011b9c5b5bd193283dfa8321ec4 /net/netrom/af_netrom.c
parentserial: 8250: Fix mismerge regarding serial_lsr_in() (diff)
parentLinux 6.2-rc7 (diff)
downloadlinux-f6b2ce79b5fbbb330f56262f0f4373d6af60b602.tar.xz
linux-f6b2ce79b5fbbb330f56262f0f4373d6af60b602.zip
Merge 6.2-rc7 into tty-next
We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/netrom/af_netrom.c')
-rw-r--r--net/netrom/af_netrom.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 6f7f4392cffb..5a4cb796150f 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -400,6 +400,11 @@ static int nr_listen(struct socket *sock, int backlog)
struct sock *sk = sock->sk;
lock_sock(sk);
+ if (sock->state != SS_UNCONNECTED) {
+ release_sock(sk);
+ return -EINVAL;
+ }
+
if (sk->sk_state != TCP_LISTEN) {
memset(&nr_sk(sk)->user_addr, 0, AX25_ADDR_LEN);
sk->sk_max_ack_backlog = backlog;