git.samba.org
/
sfrench
/
cifs-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Bluetooth: Fix race condition in hci_release_sock()
[sfrench/cifs-2.6.git]
/
net
/
bluetooth
/
hci_sock.c
diff --git
a/net/bluetooth/hci_sock.c
b/net/bluetooth/hci_sock.c
index 5756b124c2cb06f376231dbd8d8add605bd017d7..9c4a093f89607620f7d4c0c633f3bec84f10f751 100644
(file)
--- a/
net/bluetooth/hci_sock.c
+++ b/
net/bluetooth/hci_sock.c
@@
-839,6
+839,8
@@
static int hci_sock_release(struct socket *sock)
if (!sk)
return 0;
+ lock_sock(sk);
+
switch (hci_pi(sk)->channel) {
case HCI_CHANNEL_MONITOR:
atomic_dec(&monitor_promisc);
@@
-886,6
+888,7
@@
static int hci_sock_release(struct socket *sock)
skb_queue_purge(&sk->sk_receive_queue);
skb_queue_purge(&sk->sk_write_queue);
+ release_sock(sk);
sock_put(sk);
return 0;
}