In bt_sock_alloc(), we need not lock sk_peer_lock because sk has not been published to anywhere. Let's not hold sk_peer_lock in bt_sock_alloc(). Signed-off-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx> --- net/bluetooth/af_bluetooth.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index b93464ac3517..6588654429ae 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c @@ -159,10 +159,8 @@ struct sock *bt_sock_alloc(struct net *net, struct socket *sock, /* Init peer information so it can be properly monitored */ if (!kern) { - spin_lock(&sk->sk_peer_lock); sk->sk_peer_pid = get_pid(task_tgid(current)); sk->sk_peer_cred = get_current_cred(); - spin_unlock(&sk->sk_peer_lock); } return sk; -- 2.30.2