Skip to content

Commit

Permalink
Bluetooth: Allow only one LE connection attempt
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrzej Kaczmarek authored and Johan Hedberg committed Jun 5, 2012
1 parent f0f6279 commit dfc94db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
if (type == LE_LINK) {
le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst);
if (!le) {
le = hci_conn_hash_lookup_state(hdev, LE_LINK,
BT_CONNECT);
if (le)
return ERR_PTR(-EBUSY);

le = hci_conn_add(hdev, LE_LINK, dst);
if (!le)
return ERR_PTR(-ENOMEM);
Expand Down

0 comments on commit dfc94db

Please sign in to comment.