projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38d5755
)
Bluetooth: cmtp: Fix lost wakeup of session thread
author
Peter Hurley
<
[email protected]
>
Sun, 24 Jul 2011 04:11:10 +0000
(
00:11
-0400)
committer
Gustavo F. Padovan
<
[email protected]
>
Thu, 11 Aug 2011 22:50:27 +0000
(19:50 -0300)
Fix race condition which can result in missing the wakeup intended
to stop the session thread.
Signed-off-by: Peter Hurley <
[email protected]
>
Signed-off-by: Gustavo F. Padovan <
[email protected]
>
net/bluetooth/cmtp/core.c
patch
|
blob
|
history
diff --git
a/net/bluetooth/cmtp/core.c
b/net/bluetooth/cmtp/core.c
index c5b11af908be4fc3ab6c7a0cebb9639900feb162..2eb854ab10f6d157b25d5579e99de21749faf4f9 100644
(file)
--- a/
net/bluetooth/cmtp/core.c
+++ b/
net/bluetooth/cmtp/core.c
@@
-292,9
+292,11
@@
static int cmtp_session(void *arg)
init_waitqueue_entry(&wait, current);
add_wait_queue(sk_sleep(sk), &wait);
- while (
!kthread_should_stop()
) {
+ while (
1
) {
set_current_state(TASK_INTERRUPTIBLE);
+ if (kthread_should_stop())
+ break;
if (sk->sk_state != BT_CONNECTED)
break;
@@
-307,7
+309,7
@@
static int cmtp_session(void *arg)
schedule();
}
- set_current_state(TASK_RUNNING);
+
__
set_current_state(TASK_RUNNING);
remove_wait_queue(sk_sleep(sk), &wait);
down_write(&cmtp_session_sem);