UPSTREAM: Bluetooth: hci_ldisc: Fix null pointer derefence in case of early data
authorJacob Chen <jacob2.chen@rock-chips.com>
Fri, 7 Oct 2016 01:10:45 +0000 (09:10 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 7 Oct 2016 03:35:58 +0000 (11:35 +0800)
commitec6659a06ca2c6880eaec99ab08ae8c6d7a98341
treed29e31c1b3b4bc841fb2182d4b3a5535049ab63e
parent91737eb0b562e9f9d302b551d071851e68b3bb50
UPSTREAM: Bluetooth: hci_ldisc: Fix null pointer derefence in case of early data

HCI_UART_PROTO_SET flag is set before hci_uart_set_proto call. If we
receive data from tty layer during this procedure, proto pointer may
not be assigned yet, leading to null pointer dereference in rx method
hci_uart_tty_receive.

This patch fixes this issue by introducing HCI_UART_PROTO_READY flag in
order to avoid any proto operation before proto opening and assignment.

Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Change-Id: Ibe366f3222cbe7a093cd08aaecbc0de1004088c8
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
(cherry picked from commit 84cb3df02aea4b00405521e67c4c67c2d525c364)
drivers/bluetooth/hci_ldisc.c
drivers/bluetooth/hci_uart.h