Skip to content

Commit

Permalink
X.25 remove bkl in listen
Browse files Browse the repository at this point in the history
Listen updates socket values and needs lock_sock.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
AndrewHendry authored and davem330 committed Sep 15, 2010
1 parent 55b1804 commit 25aa4ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/x25/af_x25.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,14 +507,14 @@ static int x25_listen(struct socket *sock, int backlog)
struct sock *sk = sock->sk;
int rc = -EOPNOTSUPP;

lock_kernel();
lock_sock(sk);
if (sk->sk_state != TCP_LISTEN) {
memset(&x25_sk(sk)->dest_addr, 0, X25_ADDR_LEN);
sk->sk_max_ack_backlog = backlog;
sk->sk_state = TCP_LISTEN;
rc = 0;
}
unlock_kernel();
release_sock(sk);

return rc;
}
Expand Down

0 comments on commit 25aa4ef

Please sign in to comment.