diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-10-15 11:31:14 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-10-16 02:14:34 -0400 |
commit | 74da626a1098640ddc40c0e3481c0cd41e8ec1e9 (patch) | |
tree | 65e6f72f07c0cccbb37b3b079d93276b061d9ade /net/bluetooth/rfcomm | |
parent | cb19d9ea2ce2bcbe291d3d48e3501dc4f33ba627 (diff) |
[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>
Diffstat (limited to 'net/bluetooth/rfcomm')
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 530cc41f3a22..544d65b7baa7 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -336,7 +336,8 @@ static int rfcomm_sock_create(struct socket *sock, int protocol) | |||
336 | 336 | ||
337 | sock->ops = &rfcomm_sock_ops; | 337 | sock->ops = &rfcomm_sock_ops; |
338 | 338 | ||
339 | if (!(sk = rfcomm_sock_alloc(sock, protocol, GFP_KERNEL))) | 339 | sk = rfcomm_sock_alloc(sock, protocol, GFP_ATOMIC); |
340 | if (!sk) | ||
340 | return -ENOMEM; | 341 | return -ENOMEM; |
341 | 342 | ||
342 | rfcomm_sock_init(sk, NULL); | 343 | rfcomm_sock_init(sk, NULL); |