提交 788f0923 编写于 作者: C Chan-yeol Park 提交者: Johan Hedberg

Bluetooth: Fix possible NULL dereference in hci_uart_tty_receive

This patch adds a NULL check for the HCI UART ldisc driver because some
of HCI UART drivers allow hci_uart_tty_receive function to be called
even though the HCI device hasn't been registered yet.
Signed-off-by: NChan-yeol Park <chanyeol.park@samsung.com>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 c2578202
......@@ -388,7 +388,10 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, char *f
spin_lock(&hu->rx_lock);
hu->proto->recv(hu, (void *) data, count);
hu->hdev->stat.byte_rx += count;
if (hu->hdev)
hu->hdev->stat.byte_rx += count;
spin_unlock(&hu->rx_lock);
tty_unthrottle(tty);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册