Skip to content

Commit

Permalink
Bluetooth: hci_serdev: clear HCI_UART_PROTO_READY to avoid closing pr…
Browse files Browse the repository at this point in the history
…oto races

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>
  • Loading branch information
Balakrishna Godavarthi authored and Marcel Holtmann committed Sep 27, 2018
1 parent c2d7827 commit 7cf7846
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/bluetooth/hci_serdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,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);

Expand Down

0 comments on commit 7cf7846

Please sign in to comment.