Skip to content

Commit

Permalink
X.25 remove bkl in bind
Browse files Browse the repository at this point in the history
Accept updates socket values in 3 lines so wrapped with 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 25aa4ef commit 90c2729
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 @@ -688,7 +688,6 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
struct sockaddr_x25 *addr = (struct sockaddr_x25 *)uaddr;
int len, i, rc = 0;

lock_kernel();
if (!sock_flag(sk, SOCK_ZAPPED) ||
addr_len != sizeof(struct sockaddr_x25) ||
addr->sx25_family != AF_X25) {
Expand All @@ -704,12 +703,13 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
}
}

lock_sock(sk);
x25_sk(sk)->source_addr = addr->sx25_addr;
x25_insert_socket(sk);
sock_reset_flag(sk, SOCK_ZAPPED);
release_sock(sk);
SOCK_DEBUG(sk, "x25_bind: socket is bound\n");
out:
unlock_kernel();
return rc;
}

Expand Down

0 comments on commit 90c2729

Please sign in to comment.