Skip to content

Commit eb73b5a

Browse files
committed
Bluetooth: hci_event: Fix sending MGMT_EV_DEVICE_FOUND for invalid address
This fixes sending MGMT_EV_DEVICE_FOUND for invalid address (00:00:00:00:00:00) which is a regression introduced by a2ec905 ("Bluetooth: fix kernel oops in store_pending_adv_report") since in the attempt to skip storing data for extended advertisement it actually made the code to skip the entire if statement supposed to send MGMT_EV_DEVICE_FOUND without attempting to use the last_addr_adv which is garanteed to be invalid for extended advertisement since we never store anything on it. Link: bluez/bluez#1157 Link: bluez/bluez#1149 (comment) Fixes: a2ec905 ("Bluetooth: fix kernel oops in store_pending_adv_report") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent eaa517b commit eb73b5a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/bluetooth/hci_event.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6160,11 +6160,12 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
61606160
* event or send an immediate device found event if the data
61616161
* should not be stored for later.
61626162
*/
6163-
if (!ext_adv && !has_pending_adv_report(hdev)) {
6163+
if (!has_pending_adv_report(hdev)) {
61646164
/* If the report will trigger a SCAN_REQ store it for
61656165
* later merging.
61666166
*/
6167-
if (type == LE_ADV_IND || type == LE_ADV_SCAN_IND) {
6167+
if (!ext_adv && (type == LE_ADV_IND ||
6168+
type == LE_ADV_SCAN_IND)) {
61686169
store_pending_adv_report(hdev, bdaddr, bdaddr_type,
61696170
rssi, flags, data, len);
61706171
return;

0 commit comments

Comments
 (0)