Bluetooth: Fix check for re-enabling advertising
[firefly-linux-kernel-4.4.55.git] / net / bluetooth / hci_event.c
index 5d3095d7d4b0b56c0fb32201ef900230be69cdb1..2b3d366e5d98efb2369c86c65857a51608eca105 100644 (file)
@@ -1188,7 +1188,7 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
                                       &hdev->dev_flags))
                        hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
                else if (!test_bit(HCI_LE_ADV, &hdev->dev_flags) &&
-                        hdev->discovery.state != DISCOVERY_STARTING)
+                        hdev->discovery.state == DISCOVERY_FINDING)
                        mgmt_reenable_advertising(hdev);
 
                break;