summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/bnep/bnep.h
diff options
context:
space:
mode:
authorPeter Hurley2011-08-05 16:41:35 +0200
committerGustavo F. Padovan2011-08-12 00:50:27 +0200
commit751c10a56802513a6b057c8cf1552cecc1c9afde (patch)
tree958b4624a551577f68e0f0e357112637a10c520a /net/bluetooth/bnep/bnep.h
parentBluetooth: Don't use cmd_timer to timeout HCI reset command (diff)
downloadkernel-qcow2-linux-751c10a56802513a6b057c8cf1552cecc1c9afde.tar.gz
kernel-qcow2-linux-751c10a56802513a6b057c8cf1552cecc1c9afde.tar.xz
kernel-qcow2-linux-751c10a56802513a6b057c8cf1552cecc1c9afde.zip
Bluetooth: bnep: Fix deadlock in session deletion
Commit f4d7cd4a4c introduced the usage of kthread API. kthread_stop is a blocking function which returns only when the thread exits. In this case, the thread can't exit because it's waiting for the write lock, which is being held by bnep_del_connection() which is waiting for the thread to exit -- deadlock. Use atomic_t/wake_up_process instead to signal to the thread to exit. Signed-off-by: Jaikumar Ganesh <jaikumar@google.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/bnep/bnep.h')
-rw-r--r--net/bluetooth/bnep/bnep.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bluetooth/bnep/bnep.h b/net/bluetooth/bnep/bnep.h
index 8e6c06158f8e..e7ee5314f39a 100644
--- a/net/bluetooth/bnep/bnep.h
+++ b/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;