summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/bnep/core.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-08-22 14:20:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-22 14:20:09 -0400
commit4475a0a93f368e57d5306d4cbe9318e8c1c90c41 (patch)
treeb4b7b23d8939d3e764bf54026ae42205dc6850be /net/bluetooth/bnep/core.c
parent16a9d06c753abc44f66f88e03bbecb3f1e45d71b (diff)
parent687beaa0d1d937c327e2f97b4b4fa6c23ca70624 (diff)
downloadop-kernel-dev-4475a0a93f368e57d5306d4cbe9318e8c1c90c41.zip
op-kernel-dev-4475a0a93f368e57d5306d4cbe9318e8c1c90c41.tar.gz
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/padovan/bluetooth
Diffstat (limited to 'net/bluetooth/bnep/core.c')
-rw-r--r--net/bluetooth/bnep/core.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index ca39fcf..d9edfe8 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -484,9 +484,11 @@ static int bnep_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 (atomic_read(&s->terminate))
+ break;
/* RX */
while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
skb_orphan(skb);
@@ -504,7 +506,7 @@ static int bnep_session(void *arg)
schedule();
}
- set_current_state(TASK_RUNNING);
+ __set_current_state(TASK_RUNNING);
remove_wait_queue(sk_sleep(sk), &wait);
/* Cleanup session */
@@ -640,9 +642,10 @@ int bnep_del_connection(struct bnep_conndel_req *req)
down_read(&bnep_session_sem);
s = __bnep_get_session(req->dst);
- if (s)
- kthread_stop(s->task);
- else
+ if (s) {
+ atomic_inc(&s->terminate);
+ wake_up_process(s->task);
+ } else
err = -ENOENT;
up_read(&bnep_session_sem);
OpenPOWER on IntegriCloud