aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJakub Pawlowski <jpawlowski@google.com>2015-10-16 10:07:54 +0300
committerMarcel Holtmann <marcel@holtmann.org>2015-10-16 09:24:41 +0200
commit5157b8a503fa834e8569c7fed06981e3d3d53db0 (patch)
treebc7242ad64be49ba6db2437df4503070d9e6763b /net/bluetooth/mgmt.c
parentBluetooth: Fix conn_params list update in hci_connect_le_scan_cleanup (diff)
downloadlinux-dev-5157b8a503fa834e8569c7fed06981e3d3d53db0.tar.xz
linux-dev-5157b8a503fa834e8569c7fed06981e3d3d53db0.zip
Bluetooth: Fix initializing conn_params in scan phase
This patch makes sure that conn_params that were created just for explicit_connect, will get properly deleted during cleanup. Signed-off-by: Jakub Pawlowski <jpawlowski@google.com> Acked-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to '')
-rw-r--r--net/bluetooth/mgmt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 0ed94e6f4de9..c4fe2fee753f 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3545,6 +3545,7 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
auth_type);
} else {
u8 addr_type;
+ struct hci_conn_params *p;
/* Convert from L2CAP channel address type to HCI address type
*/
@@ -3562,7 +3563,10 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
* If connection parameters already exist, then they
* will be kept and this function does nothing.
*/
- hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type);
+ p = hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type);
+
+ if (p->auto_connect == HCI_AUTO_CONN_EXPLICIT)
+ p->auto_connect = HCI_AUTO_CONN_DISABLED;
conn = hci_connect_le_scan(hdev, &cp->addr.bdaddr,
addr_type, sec_level,