aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-05-09 03:15:40 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-05-11 02:45:05 -0400
commit22ad42033b7d2b3d7928fba9f89d1c7f8a3c9581 (patch)
treee07c8da23cb753237effd987f9d31643ec50c65e /drivers/bluetooth
parentd215874460e7657b8e104de024140e0932690450 (diff)
[Bluetooth] Fix NULL pointer dereference in HCI line discipline
Normally a serial Bluetooth device is opened, TIOSETD'ed to N_HCI line discipline, HCIUARTSETPROTO'ed and finally closed. In case the device fails to HCIUARTSETPROTO, closing it produces a NULL pointer dereference. Signed-off-by: Ohad Ben-Cohen <ohad@bencohen.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/hci_ldisc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 75c15085f81f..e8ae0d7e7716 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -307,7 +307,9 @@ static void hci_uart_tty_close(struct tty_struct *tty)
307 307
308 if (hu) { 308 if (hu) {
309 struct hci_dev *hdev = hu->hdev; 309 struct hci_dev *hdev = hu->hdev;
310 hci_uart_close(hdev); 310
311 if (hdev)
312 hci_uart_close(hdev);
311 313
312 if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) { 314 if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
313 hu->proto->close(hu); 315 hu->proto->close(hu);