mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 05:34:13 +08:00
Bluetooth: add NULL pointer check in HCI
If we fail to find a hci device pointer in hci_uart, don't try to deref the NULL one we do have. Signed-off-by: Jun Nie <njun@marvell.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
parent
183f732c3f
commit
d9319560b8
@ -311,10 +311,12 @@ static void hci_uart_tty_close(struct tty_struct *tty)
|
||||
|
||||
if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
|
||||
hu->proto->close(hu);
|
||||
if (hdev) {
|
||||
hci_unregister_dev(hdev);
|
||||
hci_free_dev(hdev);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* hci_uart_tty_wakeup()
|
||||
|
Loading…
Reference in New Issue
Block a user