Skip to content

Commit ff7f292

Browse files
Vasyl Vavrychukholtmann
authored andcommitted
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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 4622594 commit ff7f292

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

net/bluetooth/hci_core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2675,8 +2675,6 @@ void hci_unregister_dev(struct hci_dev *hdev)
26752675
list_del(&hdev->list);
26762676
write_unlock(&hci_dev_list_lock);
26772677

2678-
cancel_work_sync(&hdev->power_on);
2679-
26802678
hci_cmd_sync_clear(hdev);
26812679

26822680
if (!test_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks))

net/bluetooth/hci_sync.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4089,6 +4089,7 @@ int hci_dev_close_sync(struct hci_dev *hdev)
40894089

40904090
bt_dev_dbg(hdev, "");
40914091

4092+
cancel_work_sync(&hdev->power_on);
40924093
cancel_delayed_work(&hdev->power_off);
40934094
cancel_delayed_work(&hdev->ncmd_timer);
40944095

0 commit comments

Comments
 (0)