Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315690
b: refs/heads/master
c: dac670b
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo Padovan committed Jul 17, 2012
1 parent 991dc44 commit b54a721
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40f10224df6f00b59ab342e3d9d9ac8b50c8eada
refs/heads/master: dac670b97698f7c5584b224dd68d9d612b9ad4d7
25 changes: 13 additions & 12 deletions trunk/drivers/bluetooth/hci_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,28 +286,29 @@ static int hci_uart_tty_open(struct tty_struct *tty)
static void hci_uart_tty_close(struct tty_struct *tty)
{
struct hci_uart *hu = (void *)tty->disc_data;
struct hci_dev *hdev;

BT_DBG("tty %p", tty);

/* Detach from the tty */
tty->disc_data = NULL;

if (hu) {
struct hci_dev *hdev = hu->hdev;
if (!hu)
return;

if (hdev)
hci_uart_close(hdev);
hdev = hu->hdev;
if (hdev)
hci_uart_close(hdev);

if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
if (hdev) {
hci_unregister_dev(hdev);
hci_free_dev(hdev);
}
hu->proto->close(hu);
if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
if (hdev) {
hci_unregister_dev(hdev);
hci_free_dev(hdev);
}

kfree(hu);
hu->proto->close(hu);
}

kfree(hu);
}

/* hci_uart_tty_wakeup()
Expand Down

0 comments on commit b54a721

Please sign in to comment.