aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2011-07-25 18:36:26 -0400
committerJaikumar Ganesh <jaikumar@google.com>2011-08-02 15:11:15 -0700
commitb0ebe79d6616fbd5a1fe8f08b5a6ba5d38d19841 (patch)
tree6fdbc4d48b12b8756b9acf5541f5e57ecb90a48a /net/bluetooth
parent1a86ece6587209ab1c941e2fea6ff4943a49cc0b (diff)
downloadkernel_samsung_aries-b0ebe79d6616fbd5a1fe8f08b5a6ba5d38d19841.zip
kernel_samsung_aries-b0ebe79d6616fbd5a1fe8f08b5a6ba5d38d19841.tar.gz
kernel_samsung_aries-b0ebe79d6616fbd5a1fe8f08b5a6ba5d38d19841.tar.bz2
Bluetooth: l2cap: Fix lost wakeup waiting for ERTM acks
Fix race condition which can result in missing wakeup during l2cap socket shutdown. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index ed60204..5a0ce73 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1159,9 +1159,8 @@ int __l2cap_wait_ack(struct sock *sk)
int timeo = HZ/5;
add_wait_queue(sk_sleep(sk), &wait);
- while ((chan->unacked_frames > 0 && chan->conn)) {
- set_current_state(TASK_INTERRUPTIBLE);
-
+ set_current_state(TASK_INTERRUPTIBLE);
+ while (chan->unacked_frames > 0 && chan->conn) {
if (!timeo)
timeo = HZ/5;
@@ -1173,6 +1172,7 @@ int __l2cap_wait_ack(struct sock *sk)
release_sock(sk);
timeo = schedule_timeout(timeo);
lock_sock(sk);
+ set_current_state(TASK_INTERRUPTIBLE);
err = sock_error(sk);
if (err)