Skip to content

Commit 26c1272

Browse files
committed
Merge tag 'for-net-2022-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix deadlock when powering on. * tag 'for-net-2022-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: core: Fix deadlock on hci_power_on_sync. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 029cc09 + e36bea6 commit 26c1272

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

net/bluetooth/hci_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ int hci_dev_close(__u16 dev)
571571
goto done;
572572
}
573573

574+
cancel_work_sync(&hdev->power_on);
574575
if (hci_dev_test_and_clear_flag(hdev, HCI_AUTO_OFF))
575576
cancel_delayed_work(&hdev->power_off);
576577

@@ -2675,6 +2676,8 @@ void hci_unregister_dev(struct hci_dev *hdev)
26752676
list_del(&hdev->list);
26762677
write_unlock(&hci_dev_list_lock);
26772678

2679+
cancel_work_sync(&hdev->power_on);
2680+
26782681
hci_cmd_sync_clear(hdev);
26792682

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

net/bluetooth/hci_sync.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4088,7 +4088,6 @@ int hci_dev_close_sync(struct hci_dev *hdev)
40884088

40894089
bt_dev_dbg(hdev, "");
40904090

4091-
cancel_work_sync(&hdev->power_on);
40924091
cancel_delayed_work(&hdev->power_off);
40934092
cancel_delayed_work(&hdev->ncmd_timer);
40944093

0 commit comments

Comments
 (0)