summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZhengping Jiang <jiangzp@google.com>2023-05-25 03:11:58 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-06-06 03:13:14 +0300
commit1857c19941c87eb36ad47f22a406be5dfe5eff9f (patch)
tree805e8b268c5a8800a3e3296a5be1da2211731409 /include
parentc5d2b6fa26b5b8386a9cc902cdece3a46bef2bd2 (diff)
downloadlinux-1857c19941c87eb36ad47f22a406be5dfe5eff9f.tar.xz
Bluetooth: hci_sync: add lock to protect HCI_UNREGISTER
When the HCI_UNREGISTER flag is set, no jobs should be scheduled. Fix potential race when HCI_UNREGISTER is set after the flag is tested in hci_cmd_sync_queue. Fixes: 0b94f2651f56 ("Bluetooth: hci_sync: Fix queuing commands when HCI_UNREGISTER is set") Signed-off-by: Zhengping Jiang <jiangzp@google.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/hci_core.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 8baf34639939..fe3893855cd2 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -515,6 +515,7 @@ struct hci_dev {
struct work_struct cmd_sync_work;
struct list_head cmd_sync_work_list;
struct mutex cmd_sync_work_lock;
+ struct mutex unregister_lock;
struct work_struct cmd_sync_cancel_work;
struct work_struct reenable_adv_work;