aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/hci_event.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 5e7be804c709..68c882fd20fd 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1581,7 +1581,8 @@ 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 && !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) 1584 if (conn && conn->state == BT_CONFIG &&
1585 !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
1585 mgmt_device_connected(hdev, conn, 0, name, name_len); 1586 mgmt_device_connected(hdev, conn, 0, name, name_len);
1586 1587
1587 if (discov->state == DISCOVERY_STOPPED) 1588 if (discov->state == DISCOVERY_STOPPED)