summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hidp/sock.c
diff options
context:
space:
mode:
authorMarcel Holtmann2006-10-15 17:31:14 +0200
committerDavid S. Miller2006-10-16 08:14:34 +0200
commit74da626a1098640ddc40c0e3481c0cd41e8ec1e9 (patch)
tree65e6f72f07c0cccbb37b3b079d93276b061d9ade /net/bluetooth/hidp/sock.c
parent[Bluetooth] Check if DLC is still attached to the TTY (diff)
downloadkernel-qcow2-linux-74da626a1098640ddc40c0e3481c0cd41e8ec1e9.tar.gz
kernel-qcow2-linux-74da626a1098640ddc40c0e3481c0cd41e8ec1e9.tar.xz
kernel-qcow2-linux-74da626a1098640ddc40c0e3481c0cd41e8ec1e9.zip
[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/hidp/sock.c')
-rw-r--r--net/bluetooth/hidp/sock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c
index 6242446aa270..407fba43c1b9 100644
--- a/net/bluetooth/hidp/sock.c
+++ b/net/bluetooth/hidp/sock.c
@@ -256,7 +256,7 @@ static int hidp_sock_create(struct socket *sock, int protocol)
if (sock->type != SOCK_RAW)
return -ESOCKTNOSUPPORT;
- sk = sk_alloc(PF_BLUETOOTH, GFP_KERNEL, &hidp_proto, 1);
+ sk = sk_alloc(PF_BLUETOOTH, GFP_ATOMIC, &hidp_proto, 1);
if (!sk)
return -ENOMEM;