diff options
author | Wei-Ning Huang <wnhuang@chromium.org> | 2016-02-15 04:09:51 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2016-02-23 14:29:38 -0500 |
commit | d82142a8b1338e6a4339920863423379c27b0b16 (patch) | |
tree | 148964cff4a87302c8d55ba8c12f74e928ab5eff /net/bluetooth | |
parent | 28c971d82fb58ef7cba22e5308be6d2d2590473d (diff) |
Bluetooth: hci_core: cancel power off delayed work properly
When the HCI_AUTO_OFF flag is cleared, the power_off delayed work need
to be cancel or HCI will be powered off even if it's managed.
Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 9c0a6830ff92..2713fc86e85a 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -2021,6 +2021,7 @@ static void hci_power_on(struct work_struct *work) | |||
2021 | if (test_bit(HCI_UP, &hdev->flags) && | 2021 | if (test_bit(HCI_UP, &hdev->flags) && |
2022 | hci_dev_test_flag(hdev, HCI_MGMT) && | 2022 | hci_dev_test_flag(hdev, HCI_MGMT) && |
2023 | hci_dev_test_and_clear_flag(hdev, HCI_AUTO_OFF)) { | 2023 | hci_dev_test_and_clear_flag(hdev, HCI_AUTO_OFF)) { |
2024 | cancel_delayed_work(&hdev->power_off); | ||
2024 | hci_req_sync_lock(hdev); | 2025 | hci_req_sync_lock(hdev); |
2025 | err = __hci_req_hci_power_on(hdev); | 2026 | err = __hci_req_hci_power_on(hdev); |
2026 | hci_req_sync_unlock(hdev); | 2027 | hci_req_sync_unlock(hdev); |