From: Marcel Holtmann Date: Mon, 30 Jun 2014 14:04:12 +0000 (+0200) Subject: Bluetooth: Start background scanning only when controller is ready X-Git-Tag: firefly_0821_release~176^2~3474^2~12^2~41^2~210 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c20c02d5c8d76f39be461c25bf5de3a1dc96885e;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Johan Hedberg --- 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) struct hci_conn *conn; int err; - if (test_bit(HCI_UNREGISTER, &hdev->dev_flags)) + if (!test_bit(HCI_UP, &hdev->flags) || + test_bit(HCI_INIT, &hdev->flags) || + test_bit(HCI_SETUP, &hdev->dev_flags) || + test_bit(HCI_UNREGISTER, &hdev->dev_flags)) return; hci_req_init(&req, hdev);