]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Bluetooth: hci_serdev: clear HCI_UART_PROTO_READY to avoid closing proto races
authorBalakrishna Godavarthi <bgodavar@codeaurora.org>
Wed, 22 Aug 2018 12:04:11 +0000 (17:34 +0530)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 27 Sep 2018 09:59:58 +0000 (11:59 +0200)
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>
drivers/bluetooth/hci_serdev.c

index aa2543b3c286968fece4acee97953eb2c1fe0ba8..46e20444ba19bdbe85163eddac4c6d93b4cbab3c 100644 (file)
@@ -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);