aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-06-30 10:04:12 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:51 -0400
commitc20c02d5c8d76f39be461c25bf5de3a1dc96885e (patch)
treeade78df94d934535bd1cf95977b928b1de07a49c
parent7c264b10006f3c10f7a9ef314a213f9784d9ca1f (diff)
Bluetooth: Start background scanning only when controller is ready
When the controller is not active or in init/setup phase, do not try to start or stop background scanning. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/hci_core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index adea7de95633..2312e77582b0 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -5317,7 +5317,10 @@ void hci_update_background_scan(struct hci_dev *hdev)
5317 struct hci_conn *conn; 5317 struct hci_conn *conn;
5318 int err; 5318 int err;
5319 5319
5320 if (test_bit(HCI_UNREGISTER, &hdev->dev_flags)) 5320 if (!test_bit(HCI_UP, &hdev->flags) ||
5321 test_bit(HCI_INIT, &hdev->flags) ||
5322 test_bit(HCI_SETUP, &hdev->dev_flags) ||
5323 test_bit(HCI_UNREGISTER, &hdev->dev_flags))
5321 return; 5324 return;
5322 5325
5323 hci_req_init(&req, hdev); 5326 hci_req_init(&req, hdev);