aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorAnderson Briglia <anderson.briglia@openbossa.org>2011-02-21 13:09:23 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-21 15:57:41 -0500
commit15c4794fe247d85ce38eb5f5e2a5855d996f56cd (patch)
treeedc8eb2aec26ad9a97c0480feb19e43208f27c5b /net/bluetooth
parenta664b5bc77fbc80c163de5606114659d3cbeb043 (diff)
Bluetooth: Fix LE conn creation
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. Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org> Signed-off-by: Ville Tervo <ville.tervo@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_conn.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 6d8b988d9ef6..4504cb6af6ae 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -430,8 +430,9 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
430 430
431 if (type == LE_LINK) { 431 if (type == LE_LINK) {
432 le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst); 432 le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst);
433 if (!le) 433 if (le)
434 le = hci_conn_add(hdev, LE_LINK, dst); 434 return NULL;
435 le = hci_conn_add(hdev, LE_LINK, dst);
435 if (!le) 436 if (!le)
436 return NULL; 437 return NULL;
437 if (le->state == BT_OPEN) 438 if (le->state == BT_OPEN)