Skip to content

Commit

Permalink
Bluetooth: Fix using NULL inquiry entry
Browse files Browse the repository at this point in the history
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.

Cc: stable@vger.kernel.org
Signed-off-by: Ram Malovany <ramm@ti.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
  • Loading branch information
Ram Malovany authored and Gustavo Padovan committed Aug 6, 2012
1 parent a9ea3ed commit c810089
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c810089

Please sign in to comment.