Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfc94dbd authored by Andrzej Kaczmarek's avatar Andrzej Kaczmarek Committed by Johan Hedberg
Browse files

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: default avatarAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent f0f62799
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);