From: Andre Guedes Date: Tue, 6 Mar 2012 22:37:06 +0000 (-0300) Subject: Bluetooth: Check FINDING state in interleaved discovery X-Git-Tag: firefly_0821_release~3680^2~2713^2~3^2~18^2^2~112 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bc3dd33cef001e61da0f71b5d8f918b3dbaa4a94;p=firefly-linux-kernel-4.4.55.git Bluetooth: Check FINDING state in interleaved discovery In order to do interleaved discovery we should be in DISCOVERY_ FINDING state. Otherwise, discovery should be stopped. Signed-off-by: Andre Guedes Signed-off-by: Gustavo F. Padovan --- diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 982ae3c52db4..50ff9a989531 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -1098,7 +1098,8 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev, schedule_delayed_work(&hdev->adv_work, ADV_CLEAR_TIMEOUT); - if (hdev->discovery.type == DISCOV_TYPE_INTERLEAVED) { + if (hdev->discovery.type == DISCOV_TYPE_INTERLEAVED && + hdev->discovery.state == DISCOVERY_FINDING) { mgmt_interleaved_discovery(hdev); } else { hci_dev_lock(hdev);