diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 9d5057cef30a..158b11553e9e 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -1681,6 +1681,7 @@ struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst, struct hci_conn *acl; struct hci_conn *sco; struct hci_link *link; + char add_sco = 0; acl = hci_connect_acl(hdev, dst, BT_SECURITY_LOW, HCI_AT_NO_BONDING, CONN_REASON_SCO_CONNECT); @@ -1694,12 +1695,16 @@ struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst, hci_conn_drop(acl); return ERR_PTR(-ENOMEM); } + add_sco = 1; } link = hci_conn_link(acl, sco); if (!link) { hci_conn_drop(acl); - hci_conn_drop(sco); + if (!add_sco) + hci_conn_drop(sco); + else + hci_conn_del(sco); return ERR_PTR(-ENOLINK); }