Commit:     22ad42033b7d2b3d7928fba9f89d1c7f8a3c9581
Parent:     d215874460e7657b8e104de024140e0932690450
Author:     Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 09:15:40 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu May 10 23:45:05 2007 -0700

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
 drivers/bluetooth/hci_ldisc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 75c1508..e8ae0d7 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)
        if (hu) {
                struct hci_dev *hdev = hu->hdev;
-               hci_uart_close(hdev);
+               if (hdev)
+                       hci_uart_close(hdev);
                if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to