From f7c0e32a98d08838c9cda41a96cb7bd8c0abc373 Mon Sep 17 00:00:00 2001 From: Peter Hurley Date: Fri, 5 Aug 2011 10:41:35 -0400 Subject: [PATCH] --- yaml --- r: 263527 b: refs/heads/master c: 751c10a56802513a6b057c8cf1552cecc1c9afde h: refs/heads/master i: 263525: 35d47a246e13e4734e72a5a4af89ee102620f683 263523: 16df98efdd7b439702763e47513154a0d4f98aa9 263519: 7d0537d99e21cd038b361ddb5429f600944385a6 v: v3 --- [refs] | 2 +- trunk/net/bluetooth/bnep/bnep.h | 1 + trunk/net/bluetooth/bnep/core.c | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 0f8c99e8dc92..f6306407e1ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7bdb8a5cf17f66614a9897645efcd4ccc27535ee +refs/heads/master: 751c10a56802513a6b057c8cf1552cecc1c9afde diff --git a/trunk/net/bluetooth/bnep/bnep.h b/trunk/net/bluetooth/bnep/bnep.h index 8e6c06158f8e..e7ee5314f39a 100644 --- a/trunk/net/bluetooth/bnep/bnep.h +++ b/trunk/net/bluetooth/bnep/bnep.h @@ -155,6 +155,7 @@ struct bnep_session { unsigned int role; unsigned long state; unsigned long flags; + atomic_t terminate; struct task_struct *task; struct ethhdr eh; diff --git a/trunk/net/bluetooth/bnep/core.c b/trunk/net/bluetooth/bnep/core.c index 7e8ff3c24942..d9edfe8bf9d6 100644 --- a/trunk/net/bluetooth/bnep/core.c +++ b/trunk/net/bluetooth/bnep/core.c @@ -487,7 +487,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))) { @@ -642,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);