aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2012-05-30 09:39:21 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2012-06-04 23:34:15 -0400
commitdfc94dbdb999154dc2ff44e6011a4912c0b29e88 (patch)
tree26271a8b560a1f239fedc61a6dde79dd187f9a86 /net
parentf0f6279976c8f0768468293546785c18894a704c (diff)
Bluetooth: Allow only one LE connection attempt
Only one outgoing LE connection attempt should be possible. hci_connect() will now return -EBUSY in case there's another pending outgoing connection. Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_conn.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 1458667b2845..2fcced377e50 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -483,6 +483,11 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
483 if (type == LE_LINK) { 483 if (type == LE_LINK) {
484 le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst); 484 le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst);
485 if (!le) { 485 if (!le) {
486 le = hci_conn_hash_lookup_state(hdev, LE_LINK,
487 BT_CONNECT);
488 if (le)
489 return ERR_PTR(-EBUSY);
490
486 le = hci_conn_add(hdev, LE_LINK, dst); 491 le = hci_conn_add(hdev, LE_LINK, dst);
487 if (!le) 492 if (!le)
488 return ERR_PTR(-ENOMEM); 493 return ERR_PTR(-ENOMEM);