* [PATCH 1/1] bluetooth: add NULL pointer check in hci
@ 2010-12-07 7:01 Jun Nie
2010-12-07 15:06 ` Gustavo F. Padovan
0 siblings, 1 reply; 4+ messages in thread
From: Jun Nie @ 2010-12-07 7:01 UTC (permalink / raw)
To: Vinicius Costa Gomes; +Cc: Brian Gix, linux-bluetooth
[-- Attachment #1: Type: text/plain, Size: 40 bytes --]
Resend it to fix checkpatch.pl warning.
[-- Attachment #2: 0001-bluetooth-add-NULL-pointer-check-in-hci.patch --]
[-- Type: text/x-diff, Size: 841 bytes --]
From 75dc111b5d9f62619bbeec803b15e84412ae050e Mon Sep 17 00:00:00 2001
From: Jun Nie <njun@marvell.com>
Date: Tue, 7 Dec 2010 14:03:38 +0800
Subject: [PATCH] bluetooth: add NULL pointer check in hci
Signed-off-by: Jun Nie <njun@marvell.com>
---
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..3c6cabc 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
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/1] bluetooth: add NULL pointer check in hci
2010-12-07 7:01 [PATCH 1/1] bluetooth: add NULL pointer check in hci Jun Nie
@ 2010-12-07 15:06 ` Gustavo F. Padovan
2010-12-08 5:46 ` Jun Nie
0 siblings, 1 reply; 4+ messages in thread
From: Gustavo F. Padovan @ 2010-12-07 15:06 UTC (permalink / raw)
To: Jun Nie; +Cc: Vinicius Costa Gomes, Brian Gix, linux-bluetooth
Hi Jun,
* Jun Nie <niej0001@gmail.com> [2010-12-07 15:01:21 +0800]:
> Resend it to fix checkpatch.pl warning.
> From 75dc111b5d9f62619bbeec803b15e84412ae050e Mon Sep 17 00:00:00 2001
> From: Jun Nie <njun@marvell.com>
> Date: Tue, 7 Dec 2010 14:03:38 +0800
> Subject: [PATCH] bluetooth: add NULL pointer check in hci
Clearly a bug fix, but can you add a commit message to your patch. Thanks.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] bluetooth: add NULL pointer check in hci
2010-12-07 15:06 ` Gustavo F. Padovan
@ 2010-12-08 5:46 ` Jun Nie
2010-12-08 15:26 ` Gustavo F. Padovan
0 siblings, 1 reply; 4+ messages in thread
From: Jun Nie @ 2010-12-08 5:46 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: Vinicius Costa Gomes, Brian Gix, linux-bluetooth
[-- Attachment #1: Type: text/plain, Size: 576 bytes --]
2010/12/7 Gustavo F. Padovan <padovan@profusion.mobi>:
> Hi Jun,
>
> * Jun Nie <niej0001@gmail.com> [2010-12-07 15:01:21 +0800]:
>
>> Resend it to fix checkpatch.pl warning.
>
>> From 75dc111b5d9f62619bbeec803b15e84412ae050e Mon Sep 17 00:00:00 2001
>> From: Jun Nie <njun@marvell.com>
>> Date: Tue, 7 Dec 2010 14:03:38 +0800
>> Subject: [PATCH] bluetooth: add NULL pointer check in hci
>
> Clearly a bug fix, but can you add a commit message to your patch. Thanks.
>
> --
> Gustavo F. Padovan
> http://profusion.mobi
>
Add commit message for understanding in a glance.
Jun
[-- Attachment #2: 0001-bluetooth-add-NULL-pointer-check-in-hci.patch --]
[-- Type: text/x-diff, Size: 939 bytes --]
From e729eda3b2cfae501c704e2eb39e07aa1b8607f0 Mon Sep 17 00:00:00 2001
From: Jun Nie <njun@marvell.com>
Date: Tue, 7 Dec 2010 14:03:38 +0800
Subject: [PATCH] bluetooth: add NULL pointer check in hci
If we fail to find a hci device pointer in hci_uart, don't try
to deref the NULL one we do have.
Signed-off-by: Jun Nie <njun@marvell.com>
---
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..3c6cabc 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
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/1] bluetooth: add NULL pointer check in hci
2010-12-08 5:46 ` Jun Nie
@ 2010-12-08 15:26 ` Gustavo F. Padovan
0 siblings, 0 replies; 4+ messages in thread
From: Gustavo F. Padovan @ 2010-12-08 15:26 UTC (permalink / raw)
To: Jun Nie; +Cc: Vinicius Costa Gomes, Brian Gix, linux-bluetooth
Hi Jun,
* Jun Nie <niej0001@gmail.com> [2010-12-08 13:46:34 +0800]:
> From e729eda3b2cfae501c704e2eb39e07aa1b8607f0 Mon Sep 17 00:00:00 2001
> From: Jun Nie <njun@marvell.com>
> Date: Tue, 7 Dec 2010 14:03:38 +0800
> Subject: [PATCH] bluetooth: add NULL pointer check in hci
>
> If we fail to find a hci device pointer in hci_uart, don't try
> to deref the NULL one we do have.
>
> Signed-off-by: Jun Nie <njun@marvell.com>
> ---
> drivers/bluetooth/hci_ldisc.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
Patch is applied now, thanks.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-08 15:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-07 7:01 [PATCH 1/1] bluetooth: add NULL pointer check in hci Jun Nie
2010-12-07 15:06 ` Gustavo F. Padovan
2010-12-08 5:46 ` Jun Nie
2010-12-08 15:26 ` Gustavo F. Padovan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).