summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-07 13:24:59 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-07-07 12:36:39 +0200
commitae23ada43d7d644e563a23d4c2cd2aa828be1431 (patch)
treec1d981152a491ad211762b41e61196693258c40a /net/bluetooth/hci_core.c
parentbb3e0a336ae683332c1282d1e84b371b65aba1b4 (diff)
downloadop-kernel-dev-ae23ada43d7d644e563a23d4c2cd2aa828be1431.zip
op-kernel-dev-ae23ada43d7d644e563a23d4c2cd2aa828be1431.tar.gz
Bluetooth: Don't let background scanning interfering with discovery
If we have an active discovery going on we shouldn't do any changes to LE scanning when hci_update_background_scan() is called (a call which can happen for many different reasons). This patch fixes the issue by returning from the function if the discovery state is anything else except DISCOVERY_STOPPED. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 6a0e39f..4f8ba49 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -5403,6 +5403,10 @@ void hci_update_background_scan(struct hci_dev *hdev)
test_bit(HCI_UNREGISTER, &hdev->dev_flags))
return;
+ /* If discovery is active don't interfere with it */
+ if (hdev->discovery.state != DISCOVERY_STOPPED)
+ return;
+
hci_req_init(&req, hdev);
if (list_empty(&hdev->pend_le_conns) &&
OpenPOWER on IntegriCloud