summaryrefslogtreecommitdiff
path: root/net/bluetooth/bnep/core.c
diff options
context:
space:
mode:
authorBenn Pörscke <benn.porscke@stericsson.com>2011-12-16 15:04:55 +0100
committerBenn Pörscke <benn.porscke@stericsson.com>2011-12-16 15:04:55 +0100
commit93f379e6cfadfded0d262192ca69d1abc096d90e (patch)
tree43f180e31ee26ee94f7d2dd559132c30c6476b4d /net/bluetooth/bnep/core.c
parent77955e37bd395f789900b8e180991ad67cabd899 (diff)
Change-Id: I2fcf46d1fc4b0cd4c61e5be3654c43b80db86015
Diffstat (limited to 'net/bluetooth/bnep/core.c')
-rw-r--r--net/bluetooth/bnep/core.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index e1c5c1b13d3..b7026f35a9b 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -522,7 +522,7 @@ static int bnep_session(void *arg)
while (1) {
set_current_state(TASK_INTERRUPTIBLE);
- if (kthread_should_stop())
+ if (atomic_read(&s->terminate))
break;
/* RX */
while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
@@ -677,9 +677,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);