summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorRam Malovany <ramm@ti.com>2012-07-19 10:26:09 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-14 09:59:26 -0700
commit27c3ea1ee98c3e25642b12ecf0b4ca5dc7a60f51 (patch)
tree9951e80fe5569e0262de061fb2bae0e686e2ce77 /net
parent7c3b873743b682dc1c66cac3eb4fdcba3f567a3a (diff)
Bluetooth: Fix using NULL inquiry entry
commit c810089c27e48b816181b454fcc493d19fdbc2ba upstream. 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> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_event.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 94ad124a4ea3..a3bd3ed84504 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1375,6 +1375,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;