summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/amp.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-11-14 17:39:30 +0200
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-11-19 19:30:00 -0200
commita514b17fab51c1433db920d76cf8ddda959e5da0 (patch)
treeaedaf1cdddec615c2938813b57c7e5fc18c9199a /net/bluetooth/amp.c
parent522db70286fcce420e5fc1be107912fbd3806323 (diff)
downloadlinux-a514b17fab51c1433db920d76cf8ddda959e5da0.tar.bz2
Bluetooth: Refactor locking in amp_physical_cfm
Remove locking from l2cap_physical_cfm and lock chan inside amp_physical_cfm. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/amp.c')
-rw-r--r--net/bluetooth/amp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c
index 4b2fea6c1c2a..eaf473ffeef9 100644
--- a/net/bluetooth/amp.c
+++ b/net/bluetooth/amp.c
@@ -386,13 +386,17 @@ void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon)
bredr_chan = mgr->bredr_chan;
+ l2cap_chan_lock(bredr_chan);
+
set_bit(FLAG_EFS_ENABLE, &bredr_chan->flags);
bredr_chan->remote_amp_id = hs_hcon->remote_id;
bredr_chan->hs_hcon = hs_hcon;
bredr_chan->conn->mtu = hs_hcon->hdev->block_mtu;
bredr_chan->fcs = L2CAP_FCS_NONE;
- l2cap_physical_cfm(bredr_chan, 0);
+ __l2cap_physical_cfm(bredr_chan, 0);
+
+ l2cap_chan_unlock(bredr_chan);
hci_dev_put(bredr_hdev);
}