[Bluetooth] Add locking for bt_proto array manipulation
The bt_proto array needs to be protected by some kind of locking to prevent a race condition between bt_sock_create and bt_sock_register. And in addition all calls to sk_alloc need to be made GFP_ATOMIC now. Signed-off-by: Masatake YAMATO <jet@gyve.org> Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
committed by
David S. Miller
parent
cb19d9ea2c
commit
74da626a10
@@ -452,7 +452,8 @@ static int sco_sock_create(struct socket *sock, int protocol)
|
||||
|
||||
sock->ops = &sco_sock_ops;
|
||||
|
||||
if (!(sk = sco_sock_alloc(sock, protocol, GFP_KERNEL)))
|
||||
sk = sco_sock_alloc(sock, protocol, GFP_ATOMIC);
|
||||
if (!sk)
|
||||
return -ENOMEM;
|
||||
|
||||
sco_sock_init(sk, NULL);
|
||||
|
||||
Reference in New Issue
Block a user