Bluetooth: invert locking order in connect path
authorGustavo F. Padovan <padovan@profusion.mobi>
Fri, 9 Dec 2011 06:48:17 +0000 (04:48 -0200)
committerGustavo F. Padovan <padovan@profusion.mobi>
Sun, 18 Dec 2011 19:07:57 +0000 (17:07 -0200)
commit03a001948166d966d0d580cddb8ae3a23f8b795b
tree341ca43e5feca84870e874eecfc03881e60179d5
parentf878fcad1760247c054a9c80964d0b7450d2379b
Bluetooth: invert locking order in connect path

This move some checking code that was in l2cap_sock_connect() to
l2cap_chan_connect(). Thus we can invert the lock calls, i.e., call
lock_sock() before hci_dev_lock() to avoid a deadlock scenario.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
include/net/bluetooth/l2cap.h
net/bluetooth/l2cap_core.c
net/bluetooth/l2cap_sock.c