Bluetooth: hci_sync: add lock to protect HCI_UNREGISTER
authorZhengping Jiang <jiangzp@google.com>
Thu, 25 May 2023 00:11:58 +0000 (17:11 -0700)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 6 Jun 2023 00:13:14 +0000 (17:13 -0700)
commit1857c19941c87eb36ad47f22a406be5dfe5eff9f
tree805e8b268c5a8800a3e3296a5be1da2211731409
parentc5d2b6fa26b5b8386a9cc902cdece3a46bef2bd2
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>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c
net/bluetooth/hci_sync.c