diff options
Diffstat (limited to 'drivers/bluetooth/hci_ldisc.c')
-rw-r--r-- | drivers/bluetooth/hci_ldisc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 0f4203b499af..6055b9c0ac0f 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c | |||
@@ -307,7 +307,9 @@ static void hci_uart_tty_close(struct tty_struct *tty) | |||
307 | 307 | ||
308 | if (hu) { | 308 | if (hu) { |
309 | struct hci_dev *hdev = hu->hdev; | 309 | struct hci_dev *hdev = hu->hdev; |
310 | hci_uart_close(hdev); | 310 | |
311 | if (hdev) | ||
312 | hci_uart_close(hdev); | ||
311 | 313 | ||
312 | if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) { | 314 | if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) { |
313 | hu->proto->close(hu); | 315 | hu->proto->close(hu); |
@@ -473,12 +475,18 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file, | |||
473 | tty->low_latency = 1; | 475 | tty->low_latency = 1; |
474 | } else | 476 | } else |
475 | return -EBUSY; | 477 | return -EBUSY; |
478 | break; | ||
476 | 479 | ||
477 | case HCIUARTGETPROTO: | 480 | case HCIUARTGETPROTO: |
478 | if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) | 481 | if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) |
479 | return hu->proto->id; | 482 | return hu->proto->id; |
480 | return -EUNATCH; | 483 | return -EUNATCH; |
481 | 484 | ||
485 | case HCIUARTGETDEVICE: | ||
486 | if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) | ||
487 | return hu->hdev->id; | ||
488 | return -EUNATCH; | ||
489 | |||
482 | default: | 490 | default: |
483 | err = n_tty_ioctl(tty, file, cmd, arg); | 491 | err = n_tty_ioctl(tty, file, cmd, arg); |
484 | break; | 492 | break; |