diff options
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r-- | net/bluetooth/hci_conn.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index ca283a0f63ea..4e38b4872865 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -447,13 +447,22 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 | |||
447 | BT_DBG("%s dst %s", hdev->name, batostr(dst)); | 447 | BT_DBG("%s dst %s", hdev->name, batostr(dst)); |
448 | 448 | ||
449 | if (type == LE_LINK) { | 449 | if (type == LE_LINK) { |
450 | struct adv_entry *entry; | ||
451 | |||
450 | le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst); | 452 | le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst); |
451 | if (le) | 453 | if (le) |
452 | return ERR_PTR(-EBUSY); | 454 | return ERR_PTR(-EBUSY); |
455 | |||
456 | entry = hci_find_adv_entry(hdev, dst); | ||
457 | if (!entry) | ||
458 | return ERR_PTR(-EHOSTUNREACH); | ||
459 | |||
453 | le = hci_conn_add(hdev, LE_LINK, dst); | 460 | le = hci_conn_add(hdev, LE_LINK, dst); |
454 | if (!le) | 461 | if (!le) |
455 | return ERR_PTR(-ENOMEM); | 462 | return ERR_PTR(-ENOMEM); |
456 | 463 | ||
464 | le->dst_type = entry->bdaddr_type; | ||
465 | |||
457 | hci_le_connect(le); | 466 | hci_le_connect(le); |
458 | 467 | ||
459 | hci_conn_hold(le); | 468 | hci_conn_hold(le); |