Commit d160b74d authored by Dean Jenkins's avatar Dean Jenkins Committed by Marcel Holtmann

Bluetooth: hci_ldisc: Add missing clear HCI_UART_PROTO_READY

Ensure that HCI_UART_PROTO_READY is cleared before close(hu) is
called which closes the Data Link protocol layer.

Therefore, add the missing bit clear of HCI_UART_PROTO_READY to
hci_uart_init_work() so that the flag is cleared when
hci_register_dev fails.

Without the fix, the functions of the Data Link protocol layer could
potentially be accessed after that layer has been closed. This
could lead to a crash as memory would have been freed in that layer.
Signed-off-by: default avatarDean Jenkins <Dean_Jenkins@mentor.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent a225b8c7
...@@ -188,6 +188,7 @@ static void hci_uart_init_work(struct work_struct *work) ...@@ -188,6 +188,7 @@ static void hci_uart_init_work(struct work_struct *work)
hdev = hu->hdev; hdev = hu->hdev;
hu->hdev = NULL; hu->hdev = NULL;
hci_free_dev(hdev); hci_free_dev(hdev);
clear_bit(HCI_UART_PROTO_READY, &hu->flags);
hu->proto->close(hu); hu->proto->close(hu);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment