Skip to contentSkip to conversation

Bluetooth: Fix LE conn creation

PATCH Applied [email protected] 2 participants 2 messages Feb 21, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Bluetooth: Fix LE conn creation

From: Anderson Briglia <[email protected]>

This patch prevents a crash when remote host tries to create a LE link which already exists. i.e.: call l2test twice passing the same parameters.

---
 net/bluetooth/hci_conn.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
net/bluetooth/hci_conn.c +3 -2
index a050a69..d401775 100644
@@ -429,8 +429,9 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
 
 	if (type == LE_LINK) {
 		le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst);
-		if (!le)
-			le = hci_conn_add(hdev, LE_LINK, dst);
+		if (le)
+			return NULL;
+		le = hci_conn_add(hdev, LE_LINK, dst);
 		if (!le)
 			return NULL;
 		if (le->state == BT_OPEN)
Signature · 1 line
1.7.1
#1 lore raw

Hi Briglia,

Quoted 11 lines · * [email protected] <[email protected]> [2011-02-21…

From: Anderson Briglia <[email protected]>

This patch prevents a crash when remote host tries to create a LE link which already exists. i.e.: call l2test twice passing the same parameters.

---
 net/bluetooth/hci_conn.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

Signature · 2 lines
Gustavo F. Padovan
http://profusion.mobi