Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c810089c authored by Ram Malovany's avatar Ram Malovany Committed by Gustavo Padovan
Browse files

Bluetooth: Fix using NULL inquiry entry



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: default avatarRam Malovany <ramm@ti.com>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent a9ea3ed9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;