mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Bluetooth: Mgmt Device Found Event
We only want to send Mgmt Device Found Events if we are running the Device Discovery procedure (started by the MGMT Start Discovery Command). Inquiry or LE scanning triggered by HCI raw interface (e.g. hcitool) or kernel internals should not send Mgmt Device Found Events. Signed-off-by: Andre Guedes <[email protected]> Acked-by: Johan Hedberg <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
This commit is contained in:
parent
8892d8beb3
commit
12602d0cc0
1 changed files with 3 additions and 0 deletions
|
|
@ -4180,6 +4180,9 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
|
|||
struct mgmt_ev_device_found *ev = (void *) buf;
|
||||
size_t ev_size;
|
||||
|
||||
if (!hci_discovery_active(hdev))
|
||||
return -EPERM;
|
||||
|
||||
/* Leave 5 bytes for a potential CoD field */
|
||||
if (sizeof(*ev) + eir_len + 5 > sizeof(buf))
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue