]> git.karo-electronics.de Git - linux-beck.git/commit
Bluetooth: Fix L2CAP socket lock nesting level
authorJohan Hedberg <johan.hedberg@intel.com>
Wed, 12 Nov 2014 20:22:22 +0000 (22:22 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 13 Nov 2014 06:49:09 +0000 (07:49 +0100)
commit3b2ab39e26c90aac947f120b0e27c5277c660d79
tree76ab2b5bcb37a725524aa738119c438c1104effd
parentabe84903a8efc6b83fa92161429e0e3a28bde15c
Bluetooth: Fix L2CAP socket lock nesting level

The teardown callback for L2CAP channels is problematic in that it is
explicitly called for all types of channels from l2cap_chan_del(),
meaning it's not possible to hard-code a nesting level when taking the
socket lock. The simplest way to have a correct nesting level for the
socket locking is to use the same value as for the chan. This also means
that the other places trying to lock parent sockets need to be update to
use the chan value (since L2CAP_NESTING_PARENT is defined as 2 whereas
SINGLE_DEPTH_NESTING has the value 1).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap_sock.c