diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-11-11 04:33:24 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-11 04:34:52 -0500 |
commit | 60cb49d2c92969f7b0e7da863fc0cbe3ec0c715c (patch) | |
tree | 478f4e4f82d5ce7def6486dd51ad32e3eb4f51b3 /net/bluetooth/hci_event.c | |
parent | f66261408615093e58e515a1cfefd597c9990e27 (diff) |
Bluetooth: Fix mgmt connected notification
This patch fixes a regression that was introduced by commit
cb77c3ec075a50e9f956f62dc2e4c0394df1d578. In addition to BT_CONFIG,
BT_CONNECTED is also a state in which we may get a remote name and need
to indicate over mgmt the connection status. This scenario is
particularly likely to happen for incoming connections that do not need
authentication since there the hci_conn state will reach BT_CONNECTED
before the remote name is received.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 68c882fd20fd..aec3b1dce1cc 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1581,7 +1581,13 @@ static void hci_check_pending_name(struct hci_dev *hdev, struct hci_conn *conn, | |||
1581 | struct discovery_state *discov = &hdev->discovery; | 1581 | struct discovery_state *discov = &hdev->discovery; |
1582 | struct inquiry_entry *e; | 1582 | struct inquiry_entry *e; |
1583 | 1583 | ||
1584 | if (conn && conn->state == BT_CONFIG && | 1584 | /* Update the mgmt connected state if necessary. Be careful with |
1585 | * conn objects that exist but are not (yet) connected however. | ||
1586 | * Only those in BT_CONFIG or BT_CONNECTED states can be | ||
1587 | * considered connected. | ||
1588 | */ | ||
1589 | if (conn && | ||
1590 | (conn->state == BT_CONFIG || conn->state == BT_CONNECTED) && | ||
1585 | !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) | 1591 | !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) |
1586 | mgmt_device_connected(hdev, conn, 0, name, name_len); | 1592 | mgmt_device_connected(hdev, conn, 0, name, name_len); |
1587 | 1593 | ||