mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04: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 <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
This commit is contained in:
parent
183f732c3f
commit
d9319560b8
1 changed files with 4 additions and 2 deletions
|
|
@ -311,8 +311,10 @@ 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);
|
||||
hci_unregister_dev(hdev);
|
||||
hci_free_dev(hdev);
|
||||
if (hdev) {
|
||||
hci_unregister_dev(hdev);
|
||||
hci_free_dev(hdev);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue