>From 6e396f74efeb13e468804c19249424cb3a5f93d8 Mon Sep 17 00:00:00 2001 From: Jun Nie <njun@xxxxxxxxxxx> Date: Tue, 7 Dec 2010 14:03:38 +0800 Subject: [PATCH] bluetooth: add NULL pointer check in hci Signed-off-by: Jun Nie <njun@xxxxxxxxxxx> --- drivers/bluetooth/hci_ldisc.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 7201482..b58936c 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -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); + } } } } -- 1.7.0.4
From 6e396f74efeb13e468804c19249424cb3a5f93d8 Mon Sep 17 00:00:00 2001 From: Jun Nie <njun@xxxxxxxxxxx> Date: Tue, 7 Dec 2010 14:03:38 +0800 Subject: [PATCH] bluetooth: add NULL pointer check in hci Signed-off-by: Jun Nie <njun@xxxxxxxxxxx> --- drivers/bluetooth/hci_ldisc.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 7201482..b58936c 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -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); + } } } } -- 1.7.0.4