aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/hci_ldisc.c
diff options
context:
space:
mode:
authorDean Jenkins <Dean_Jenkins@mentor.com>2017-04-20 13:06:41 -0400
committerMarcel Holtmann <marcel@holtmann.org>2017-04-22 04:28:40 -0400
commitd160b74da85a4ec072b076db056e27ba7246eba0 (patch)
treed7c0d6f55b9843a786bdaf98f25ff04d1510339b /drivers/bluetooth/hci_ldisc.c
parenta225b8c70af9368cfcb52a3608bc862bc88a7801 (diff)
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: Dean Jenkins <Dean_Jenkins@mentor.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/hci_ldisc.c')
-rw-r--r--drivers/bluetooth/hci_ldisc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index b1096d1ab30e..c53513cb7654 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -188,6 +188,7 @@ static void hci_uart_init_work(struct work_struct *work)
188 hdev = hu->hdev; 188 hdev = hu->hdev;
189 hu->hdev = NULL; 189 hu->hdev = NULL;
190 hci_free_dev(hdev); 190 hci_free_dev(hdev);
191 clear_bit(HCI_UART_PROTO_READY, &hu->flags);
191 hu->proto->close(hu); 192 hu->proto->close(hu);
192 return; 193 return;
193 } 194 }