diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-08-22 14:20:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-22 14:20:09 -0400 |
commit | 4475a0a93f368e57d5306d4cbe9318e8c1c90c41 (patch) | |
tree | b4b7b23d8939d3e764bf54026ae42205dc6850be /net/bluetooth/bnep/core.c | |
parent | 16a9d06c753abc44f66f88e03bbecb3f1e45d71b (diff) | |
parent | 687beaa0d1d937c327e2f97b4b4fa6c23ca70624 (diff) | |
download | op-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.c | 13 |
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); |