aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/bluetooth/hci_sync.c
diff options
context:
space:
mode:
authorVasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>2022-04-26 11:18:23 +0300
committerMarcel Holtmann <marcel@holtmann.org>2022-05-13 13:05:49 +0200
commitff7f2926114d3a50f5ffe461a9bce8d761748da5 (patch)
tree219c8445a587f1c33bb93442f53e92fd9a5d4830 /net/bluetooth/hci_sync.c
parentBluetooth: btusb: add support for Qualcomm WCN785x (diff)
downloadwireguard-linux-ff7f2926114d3a50f5ffe461a9bce8d761748da5.tar.xz
wireguard-linux-ff7f2926114d3a50f5ffe461a9bce8d761748da5.zip
Bluetooth: core: Fix missing power_on work cancel on HCI close
Move power_on work cancel to hci_dev_close_sync to ensure that power_on work is canceled after HCI interface down, power off, rfkill, etc. For example, if hciconfig hci0 down is done early enough during boot, it may run before power_on work. Then, power_on work will actually bring up interface despite above hciconfig command. Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_sync.c')
-rw-r--r--net/bluetooth/hci_sync.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index b06e01bef66e..a6ada9dcede5 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4089,6 +4089,7 @@ int hci_dev_close_sync(struct hci_dev *hdev)
bt_dev_dbg(hdev, "");
+ cancel_work_sync(&hdev->power_on);
cancel_delayed_work(&hdev->power_off);
cancel_delayed_work(&hdev->ncmd_timer);