Bluetooth: Fix LE conn creation
Subsystems (2)
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.
Signed-off-by Anderson Briglia <[email protected]>
Signed-off-by Ville Tervo <[email protected]>
--- net/bluetooth/hci_conn.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
net/bluetooth/hci_conn.c +3 -2
@@ -429,8 +429,9 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8if (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
Gustavo F. Padovan
AppliedHi 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.
Signed-off-by Anderson Briglia <[email protected]>Signed-off-by Ville Tervo <[email protected]>--- net/bluetooth/hci_conn.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
Applied, thanks.
Signature · 2 lines
Gustavo F. Padovan http://profusion.mobi