Bluetooth: bnep: Fix deadlock in session deletion
authorPeter Hurley <peter@hurleysoftware.com>
Fri, 5 Aug 2011 14:41:35 +0000 (10:41 -0400)
committerJaikumar Ganesh <jaikumar@google.com>
Fri, 12 Aug 2011 01:19:03 +0000 (18:19 -0700)
commit8624f2bb85de9ec7051b341d956ac1669eaebad1
tree7e631a474bbc5d7983a5bcf66ec710f5784a40e5
parentdfe4ecda301b6f01c845fc56439cdf7d351e2961
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>
net/bluetooth/bnep/bnep.h
net/bluetooth/bnep/core.c