diff options
Diffstat (limited to 'drivers/bluetooth/hci_ldisc.c')
-rw-r--r-- | drivers/bluetooth/hci_ldisc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 720148294e64..3c6cabcb7d84 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c | |||
@@ -311,8 +311,10 @@ static void hci_uart_tty_close(struct tty_struct *tty) | |||
311 | 311 | ||
312 | if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) { | 312 | if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) { |
313 | hu->proto->close(hu); | 313 | hu->proto->close(hu); |
314 | hci_unregister_dev(hdev); | 314 | if (hdev) { |
315 | hci_free_dev(hdev); | 315 | hci_unregister_dev(hdev); |
316 | hci_free_dev(hdev); | ||
317 | } | ||
316 | } | 318 | } |
317 | } | 319 | } |
318 | } | 320 | } |