2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 01:04:08 +08:00

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>
This commit is contained in:
Marcel Holtmann 2014-06-30 16:04:12 +02:00
parent 7c264b1000
commit c20c02d5c8

View File

@ -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);