diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-10-31 15:46:33 +0200 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-11-01 20:27:08 -0200 |
commit | e58917b990ef0cc3903aa962236a0dae4f1f81a0 (patch) | |
tree | 8765e325ed31ed356fde52ba2d26fcfb10c72091 /net/bluetooth/hci_event.c | |
parent | 9eef6b3a9e38d5f8ad315b2a7db153392e6a77d6 (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/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index bca71a8b127..0572f051c69 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) BT_DBG("%s status 0x%2.2x", hdev->name, status); - if (status) - return; - cp = hci_sent_cmd_data(hdev, HCI_OP_CREATE_PHY_LINK); if (!cp) return; - amp_write_remote_assoc(hdev, cp->phy_handle); + hci_dev_lock(hdev); + + if (status) { + struct hci_conn *hcon; + + hcon = hci_conn_hash_lookup_handle(hdev, cp->phy_handle); + if (hcon) + hci_conn_del(hcon); + } else { + amp_write_remote_assoc(hdev, cp->phy_handle); + } + + hci_dev_unlock(hdev); } static void hci_cs_accept_phylink(struct hci_dev *hdev, u8 status) |