]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2023 09:16:46 +0000 (11:16 +0200)
commitf202d27efbc76851fbe08ddea378123e234f11a3
tree2cc7484e23d485231c55928bf72046c3f9c429c3
parentc574a3376112220682b997d49af28d19bdd86ac4
Bluetooth: hci_sync: add lock to protect HCI_UNREGISTER

[ Upstream commit 1857c19941c87eb36ad47f22a406be5dfe5eff9f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c
net/bluetooth/hci_sync.c