diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2011-07-25 18:36:26 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-08-11 18:50:27 -0400 |
commit | a71a0cf4e9cdb1c43843977a1efc43f96f6efc21 (patch) | |
tree | dc762b8ffe1d12b9acfe6b7c317c3f40e1626522 | |
parent | 3a3f5c7df55a1294c9e6e2d0b8cea604b137438f (diff) |
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>
-rw-r--r-- | net/bluetooth/l2cap_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 3204ba8a701c..b3bdb482bbe6 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -1159,9 +1159,8 @@ int __l2cap_wait_ack(struct sock *sk) | |||
1159 | int timeo = HZ/5; | 1159 | int timeo = HZ/5; |
1160 | 1160 | ||
1161 | add_wait_queue(sk_sleep(sk), &wait); | 1161 | add_wait_queue(sk_sleep(sk), &wait); |
1162 | while ((chan->unacked_frames > 0 && chan->conn)) { | 1162 | set_current_state(TASK_INTERRUPTIBLE); |
1163 | set_current_state(TASK_INTERRUPTIBLE); | 1163 | while (chan->unacked_frames > 0 && chan->conn) { |
1164 | |||
1165 | if (!timeo) | 1164 | if (!timeo) |
1166 | timeo = HZ/5; | 1165 | timeo = HZ/5; |
1167 | 1166 | ||
@@ -1173,6 +1172,7 @@ int __l2cap_wait_ack(struct sock *sk) | |||
1173 | release_sock(sk); | 1172 | release_sock(sk); |
1174 | timeo = schedule_timeout(timeo); | 1173 | timeo = schedule_timeout(timeo); |
1175 | lock_sock(sk); | 1174 | lock_sock(sk); |
1175 | set_current_state(TASK_INTERRUPTIBLE); | ||
1176 | 1176 | ||
1177 | err = sock_error(sk); | 1177 | err = sock_error(sk); |
1178 | if (err) | 1178 | if (err) |