summaryrefslogtreecommitdiff
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorBalakrishna Godavarthi <bgodavar@codeaurora.org>2018-08-22 17:34:11 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-20 18:00:46 +0100
commit191e19752460e0cabfe0a95a75a9a1ddd9b1cdd7 (patch)
tree45cc7ddbd43a6719e059d466a018bcfe88b07368 /drivers/bluetooth
parenta8d3a42686e1c32e01f198e6af6af51ae03cfdb2 (diff)
Bluetooth: hci_serdev: clear HCI_UART_PROTO_READY to avoid closing proto races
[ Upstream commit 7cf7846d27bfc9731e449857db3eec5e0e9701ba ] Clearing HCI_UART_PROTO_READY will avoid usage of proto function pointers before running the proto close function pointer. There is chance of kernel crash, due to usage of non proto close function pointers after proto close. Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/hci_serdev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/bluetooth/hci_serdev.c b/drivers/bluetooth/hci_serdev.c
index 52e6d4d1608e..69c00a3db538 100644
--- a/drivers/bluetooth/hci_serdev.c
+++ b/drivers/bluetooth/hci_serdev.c
@@ -360,6 +360,7 @@ void hci_uart_unregister_device(struct hci_uart *hu)
{
struct hci_dev *hdev = hu->hdev;
+ clear_bit(HCI_UART_PROTO_READY, &hu->flags);
hci_unregister_dev(hdev);
hci_free_dev(hdev);