From: Wei-Ning Huang Date: Mon, 15 Feb 2016 09:09:51 +0000 (+0800) Subject: Bluetooth: hci_core: cancel power off delayed work properly X-Git-Tag: v4.9.8~2476^2~138^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d82142a8b1338e6a4339920863423379c27b0b16;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 9c0a683..2713fc8 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) if (test_bit(HCI_UP, &hdev->flags) && hci_dev_test_flag(hdev, HCI_MGMT) && hci_dev_test_and_clear_flag(hdev, HCI_AUTO_OFF)) { + cancel_delayed_work(&hdev->power_off); hci_req_sync_lock(hdev); err = __hci_req_hci_power_on(hdev); hci_req_sync_unlock(hdev);