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/rose/af_rose.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'net/rose/af_rose.c') diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 03a1ee221..4edd127bb 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -490,6 +490,12 @@ static int rose_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) { struct rose_sock *rose = rose_sk(sk); @@ -499,8 +505,10 @@ static int rose_listen(struct socket *sock, int backlog) memset(rose->dest_digis, 0, AX25_ADDR_LEN * ROSE_MAX_DIGIS); sk->sk_max_ack_backlog = backlog; sk->sk_state = TCP_LISTEN; + release_sock(sk); return 0; } + release_sock(sk); return -EOPNOTSUPP; } -- cgit v1.2.3