diff options
-rw-r--r-- | net/bluetooth/mgmt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 69d17205745b..7ae737fcf5e7 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -4180,6 +4180,9 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
4180 | struct mgmt_ev_device_found *ev = (void *) buf; | 4180 | struct mgmt_ev_device_found *ev = (void *) buf; |
4181 | size_t ev_size; | 4181 | size_t ev_size; |
4182 | 4182 | ||
4183 | if (!hci_discovery_active(hdev)) | ||
4184 | return -EPERM; | ||
4185 | |||
4183 | /* Leave 5 bytes for a potential CoD field */ | 4186 | /* Leave 5 bytes for a potential CoD field */ |
4184 | if (sizeof(*ev) + eir_len + 5 > sizeof(buf)) | 4187 | if (sizeof(*ev) + eir_len + 5 > sizeof(buf)) |
4185 | return -EINVAL; | 4188 | return -EINVAL; |