aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)