All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] Bluetooth: Fix using NULL inquiry entry .
@ 2012-07-19  7:26 ramm
  2012-07-19  7:26 ` [PATCH v2 2/3] Bluetooth: Fix using a NULL inquiry cache entry ramm
  2012-07-19  7:26 ` [PATCH v2 3/3] Bluetooth: Set name_state to unknown when entry name is empty ramm
  0 siblings, 2 replies; 6+ messages in thread
From: ramm @ 2012-07-19  7:26 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ram Malovany

From: Ram Malovany <ramm@ti.com>

If entry wasn't found in the hci_inquiry_cache_lookup_resolve do not
resolve the name.This will fix a kernel crash when trying to use NULL
pointer.

Signed-off-by: Ram Malovany <ramm@ti.com>
---
 net/bluetooth/hci_event.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 41ff978..2de521f 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1365,6 +1365,9 @@ static bool hci_resolve_next_name(struct hci_dev *hdev)
 		return false;
 
 	e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, NAME_NEEDED);
+	if (!e)
+		return false;
+
 	if (hci_resolve_name(hdev, e) == 0) {
 		e->name_state = NAME_PENDING;
 		return true;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-07-23  7:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19  7:26 [PATCH v2 1/3] Bluetooth: Fix using NULL inquiry entry ramm
2012-07-19  7:26 ` [PATCH v2 2/3] Bluetooth: Fix using a NULL inquiry cache entry ramm
2012-07-19  7:26 ` [PATCH v2 3/3] Bluetooth: Set name_state to unknown when entry name is empty ramm
2012-07-19 14:12   ` Gustavo Padovan
2012-07-19 14:27     ` Gustavo Padovan
2012-07-23  7:38       ` Malovany, Ram

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.