diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-10-11 11:41:19 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-10-11 11:41:19 -0700 |
commit | 4af6600fd793023c01634cca5abfe4a2b707788f (patch) | |
tree | 9e3a830d7782512b492011932ddd789d13a900c4 /net/bluetooth/hci_event.c | |
parent | 447a8b858e4bda41c394b1bc7fdbc9dc0bdf44f6 (diff) | |
parent | 68da166491655bc54051bf04c78ce648e2e33508 (diff) | |
download | op-kernel-dev-4af6600fd793023c01634cca5abfe4a2b707788f.zip op-kernel-dev-4af6600fd793023c01634cca5abfe4a2b707788f.tar.gz |
Merge branch 'next' into for-linus
Prepare second round of input updates for 3.18.
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index be35598..a600082 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -4221,8 +4221,13 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) hci_proto_connect_cfm(conn, ev->status); params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); - if (params) + if (params) { list_del_init(¶ms->action); + if (params->conn) { + hci_conn_drop(params->conn); + params->conn = NULL; + } + } unlock: hci_update_background_scan(hdev); @@ -4304,8 +4309,16 @@ static void check_pending_le_conn(struct hci_dev *hdev, bdaddr_t *addr, conn = hci_connect_le(hdev, addr, addr_type, BT_SECURITY_LOW, HCI_LE_AUTOCONN_TIMEOUT, HCI_ROLE_MASTER); - if (!IS_ERR(conn)) + if (!IS_ERR(conn)) { + /* Store the pointer since we don't really have any + * other owner of the object besides the params that + * triggered it. This way we can abort the connection if + * the parameters get removed and keep the reference + * count consistent once the connection is established. + */ + params->conn = conn; return; + } switch (PTR_ERR(conn)) { case -EBUSY: |