Skip to content

Commit

Permalink
Bluetooth: Remove unneeded code
Browse files Browse the repository at this point in the history
This patch removes some unneeded code from hci_cs_le_create_conn.

If the hci_conn is not found, it means this LE connection attempt
was triggered by a thrid-party tool (e.g. hcitool). We should not
create this new hci_conn in LE Create Connection command status
event since it is already properly handled in LE Connection
Complete event.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
  • Loading branch information
Andre Guedes authored and Gustavo Padovan committed Aug 6, 2012
1 parent b9b343d commit 847012c
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1638,16 +1638,6 @@ static void hci_cs_le_create_conn(struct hci_dev *hdev, __u8 status)
hci_proto_connect_cfm(conn, status);
hci_conn_del(conn);
}
} else {
if (!conn) {
conn = hci_conn_add(hdev, LE_LINK, &cp->peer_addr);
if (conn) {
conn->dst_type = cp->peer_addr_type;
conn->out = true;
} else {
BT_ERR("No memory for new connection");
}
}
}

hci_dev_unlock(hdev);
Expand Down

0 comments on commit 847012c

Please sign in to comment.