提交 d9319560 编写于 作者: J Jun Nie 提交者: Gustavo F. Padovan

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: NJun Nie <njun@marvell.com>
Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
上级 183f732c
......@@ -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);
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册