Bluetooth: bnep: Fix deadlock in session deletion
authorPeter Hurley <peter@hurleysoftware.com>
Fri, 5 Aug 2011 14:41:35 +0000 (10:41 -0400)
committerGustavo F. Padovan <padovan@profusion.mobi>
Thu, 11 Aug 2011 22:50:27 +0000 (19:50 -0300)
commit751c10a56802513a6b057c8cf1552cecc1c9afde
tree958b4624a551577f68e0f0e357112637a10c520a
parent7bdb8a5cf17f66614a9897645efcd4ccc27535ee
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