From: Balakrishna Godavarthi Date: Wed, 22 Aug 2018 12:04:11 +0000 (+0530) Subject: Bluetooth: hci_serdev: clear HCI_UART_PROTO_READY to avoid closing proto races X-Git-Tag: v4.19.85~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c8946462f074603259cca407b89a19dc42832e7;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- diff --git a/drivers/bluetooth/hci_serdev.c b/drivers/bluetooth/hci_serdev.c index aa2543b..46e2044 100644 --- a/drivers/bluetooth/hci_serdev.c +++ b/drivers/bluetooth/hci_serdev.c @@ -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);