diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-10-16 03:07:53 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-10-16 03:24:41 -0400 |
commit | 9ad3e6ffe189a988389d88ce33101668cb2d54c6 (patch) | |
tree | 75c46a0442999b52fa71fa94562d7a04fff364e4 /net | |
parent | 679d2b6f9d742b3f091868bd9a0634647ce7e782 (diff) |
Bluetooth: Fix conn_params list update in hci_connect_le_scan_cleanup
After clearing the params->explicit_connect variable the parameters
may need to be either added back to the right list or potentially left
absent from both the le_reports and the le_conns lists.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_conn.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index d5c06eeab4a3..fe99025fb649 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -91,12 +91,27 @@ static void hci_connect_le_scan_cleanup(struct hci_conn *conn) | |||
91 | * autoconnect action, remove them completely. If they are, just unmark | 91 | * autoconnect action, remove them completely. If they are, just unmark |
92 | * them as waiting for connection, by clearing explicit_connect field. | 92 | * them as waiting for connection, by clearing explicit_connect field. |
93 | */ | 93 | */ |
94 | if (params->auto_connect == HCI_AUTO_CONN_EXPLICIT) { | 94 | params->explicit_connect = false; |
95 | |||
96 | list_del_init(¶ms->action); | ||
97 | |||
98 | switch (params->auto_connect) { | ||
99 | case HCI_AUTO_CONN_EXPLICIT: | ||
95 | hci_conn_params_del(conn->hdev, bdaddr, bdaddr_type); | 100 | hci_conn_params_del(conn->hdev, bdaddr, bdaddr_type); |
96 | } else { | 101 | /* return instead of break to avoid duplicate scan update */ |
97 | params->explicit_connect = false; | 102 | return; |
98 | hci_update_background_scan(conn->hdev); | 103 | case HCI_AUTO_CONN_DIRECT: |
104 | case HCI_AUTO_CONN_ALWAYS: | ||
105 | list_add(¶ms->action, &conn->hdev->pend_le_conns); | ||
106 | break; | ||
107 | case HCI_AUTO_CONN_REPORT: | ||
108 | list_add(¶ms->action, &conn->hdev->pend_le_reports); | ||
109 | break; | ||
110 | default: | ||
111 | break; | ||
99 | } | 112 | } |
113 | |||
114 | hci_update_background_scan(conn->hdev); | ||
100 | } | 115 | } |
101 | 116 | ||
102 | static void hci_conn_cleanup(struct hci_conn *conn) | 117 | static void hci_conn_cleanup(struct hci_conn *conn) |