]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Bluetooth: hci_ldisc: Add protocol check to hci_uart_send_frame()
authorDean Jenkins <Dean_Jenkins@mentor.com>
Fri, 28 Apr 2017 12:57:24 +0000 (13:57 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 30 Apr 2017 10:22:14 +0000 (12:22 +0200)
commitab00f89fdff61975fa52a61608080ea7b8d8e800
treea80aef68616f4b4ec6f19f2ec9eabe503a2747f7
parent377a6eac58e3492fbf74fed0a5e40ee90ed73f8e
Bluetooth: hci_ldisc: Add protocol check to hci_uart_send_frame()

Before attempting to send a HCI message, check that the Data Link
protocol is still bound to the HCI UART driver. This makes the code
consistent with the usage of the other proto function pointers.

Therefore, add a check for HCI_UART_PROTO_READY into hci_uart_send_frame()
and return -EUNATCH if the Data Link protocol is not bound.

This also allows hci_send_frame() to report the error of an unbound
Data Link protocol layer. Therefore, it assists with diagnostics into
why HCI messages are being sent when the Data Link protocol is not
bound and avoids potential crashes.

Signed-off-by: Dean Jenkins <Dean_Jenkins@mentor.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_ldisc.c