diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-10-15 17:31:14 +0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-10-15 23:14:34 -0700 |
commit | 74da626a1098640ddc40c0e3481c0cd41e8ec1e9 (patch) | |
tree | 65e6f72f07c0cccbb37b3b079d93276b061d9ade /net/bluetooth/sco.c | |
parent | cb19d9ea2ce2bcbe291d3d48e3501dc4f33ba627 (diff) | |
download | linux-3.10-74da626a1098640ddc40c0e3481c0cd41e8ec1e9.tar.gz linux-3.10-74da626a1098640ddc40c0e3481c0cd41e8ec1e9.tar.bz2 linux-3.10-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/sco.c')
-rw-r--r-- | net/bluetooth/sco.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 14b0f693063..5d13d4f3175 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -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); |