diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-09 01:48:17 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-18 14:07:57 -0500 |
commit | 03a001948166d966d0d580cddb8ae3a23f8b795b (patch) | |
tree | 341ca43e5feca84870e874eecfc03881e60179d5 /include/net | |
parent | f878fcad1760247c054a9c80964d0b7450d2379b (diff) |
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>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/bluetooth/l2cap.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index f79137476cb6..c0d168adf9be 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -806,7 +806,8 @@ int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid); | |||
806 | struct l2cap_chan *l2cap_chan_create(struct sock *sk); | 806 | struct l2cap_chan *l2cap_chan_create(struct sock *sk); |
807 | void l2cap_chan_close(struct l2cap_chan *chan, int reason); | 807 | void l2cap_chan_close(struct l2cap_chan *chan, int reason); |
808 | void l2cap_chan_destroy(struct l2cap_chan *chan); | 808 | void l2cap_chan_destroy(struct l2cap_chan *chan); |
809 | int l2cap_chan_connect(struct l2cap_chan *chan); | 809 | inline int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, |
810 | bdaddr_t *dst); | ||
810 | int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, | 811 | int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, |
811 | u32 priority); | 812 | u32 priority); |
812 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); | 813 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); |