aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-10-31 09:46:33 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-11-01 18:27:08 -0400
commite58917b990ef0cc3903aa962236a0dae4f1f81a0 (patch)
tree8765e325ed31ed356fde52ba2d26fcfb10c72091 /net
parent9eef6b3a9e38d5f8ad315b2a7db153392e6a77d6 (diff)
Bluetooth: AMP: Remove hci_conn receiving error command status
When receiving HCI Event: Command Status for Create Physical Link with Error code remove AMP hcon. 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')
-rw-r--r--net/bluetooth/hci_event.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index bca71a8b1272..0572f051c693 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1809,14 +1809,23 @@ static void hci_cs_create_phylink(struct hci_dev *hdev, u8 status)
1809 1809
1810 BT_DBG("%s status 0x%2.2x", hdev->name, status); 1810 BT_DBG("%s status 0x%2.2x", hdev->name, status);
1811 1811
1812 if (status)
1813 return;
1814
1815 cp = hci_sent_cmd_data(hdev, HCI_OP_CREATE_PHY_LINK); 1812 cp = hci_sent_cmd_data(hdev, HCI_OP_CREATE_PHY_LINK);
1816 if (!cp) 1813 if (!cp)
1817 return; 1814 return;
1818 1815
1819 amp_write_remote_assoc(hdev, cp->phy_handle); 1816 hci_dev_lock(hdev);
1817
1818 if (status) {
1819 struct hci_conn *hcon;
1820
1821 hcon = hci_conn_hash_lookup_handle(hdev, cp->phy_handle);
1822 if (hcon)
1823 hci_conn_del(hcon);
1824 } else {
1825 amp_write_remote_assoc(hdev, cp->phy_handle);
1826 }
1827
1828 hci_dev_unlock(hdev);
1820} 1829}
1821 1830
1822static void hci_cs_accept_phylink(struct hci_dev *hdev, u8 status) 1831static void hci_cs_accept_phylink(struct hci_dev *hdev, u8 status)