diff options
author | Jakub Pawlowski <jpawlowski@google.com> | 2015-10-16 07:07:54 (GMT) |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-10-16 07:24:41 (GMT) |
commit | 5157b8a503fa834e8569c7fed06981e3d3d53db0 (patch) | |
tree | bc7242ad64be49ba6db2437df4503070d9e6763b /net/bluetooth/mgmt.c | |
parent | 9ad3e6ffe189a988389d88ce33101668cb2d54c6 (diff) | |
download | linux-5157b8a503fa834e8569c7fed06981e3d3d53db0.tar.xz |
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 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 0ed94e6..c4fe2fe 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, |