aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index da7ab6b9bb69..3a99f30a3317 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4226,8 +4226,13 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
4226 hci_proto_connect_cfm(conn, ev->status); 4226 hci_proto_connect_cfm(conn, ev->status);
4227 4227
4228 params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); 4228 params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
4229 if (params) 4229 if (params) {
4230 list_del_init(&params->action); 4230 list_del_init(&params->action);
4231 if (params->conn) {
4232 hci_conn_drop(params->conn);
4233 params->conn = NULL;
4234 }
4235 }
4231 4236
4232unlock: 4237unlock:
4233 hci_update_background_scan(hdev); 4238 hci_update_background_scan(hdev);
@@ -4309,8 +4314,16 @@ static void check_pending_le_conn(struct hci_dev *hdev, bdaddr_t *addr,
4309 4314
4310 conn = hci_connect_le(hdev, addr, addr_type, BT_SECURITY_LOW, 4315 conn = hci_connect_le(hdev, addr, addr_type, BT_SECURITY_LOW,
4311 HCI_LE_AUTOCONN_TIMEOUT, HCI_ROLE_MASTER); 4316 HCI_LE_AUTOCONN_TIMEOUT, HCI_ROLE_MASTER);
4312 if (!IS_ERR(conn)) 4317 if (!IS_ERR(conn)) {
4318 /* Store the pointer since we don't really have any
4319 * other owner of the object besides the params that
4320 * triggered it. This way we can abort the connection if
4321 * the parameters get removed and keep the reference
4322 * count consistent once the connection is established.
4323 */
4324 params->conn = conn;
4313 return; 4325 return;
4326 }
4314 4327
4315 switch (PTR_ERR(conn)) { 4328 switch (PTR_ERR(conn)) {
4316 case -EBUSY: 4329 case -EBUSY: