diff options
author | Abhishek Pandit-Subedi <abhishekpandit@chromium.org> | 2020-12-18 02:04:08 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2020-12-19 00:31:04 +0300 |
commit | 36211f7fc1e79d83b4a0461d9d65961ca5ef8150 (patch) | |
tree | bf2be663f7caf6ebd6caf9aafdbe0526800dc928 /net/bluetooth | |
parent | 3b0d5250be30e76727284bb9e4c26b662ede7378 (diff) | |
download | linux-36211f7fc1e79d83b4a0461d9d65961ca5ef8150.tar.xz |
Bluetooth: Pause service discovery for suspend
Just like MGMT_OP_START_DISCOVERY, we should reject
MGMT_OP_START_SERVICE_DISCOVERY with MGMT_STATUS_BUSY when we are paused
for suspend.
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index fa0f7a4a1d2f..608dda5403b7 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -4798,6 +4798,14 @@ static int start_service_discovery(struct sock *sk, struct hci_dev *hdev, goto failed; } + if (hdev->discovery_paused) { + err = mgmt_cmd_complete(sk, hdev->id, + MGMT_OP_START_SERVICE_DISCOVERY, + MGMT_STATUS_BUSY, &cp->type, + sizeof(cp->type)); + goto failed; + } + uuid_count = __le16_to_cpu(cp->uuid_count); if (uuid_count > max_uuid_count) { bt_dev_err(hdev, "service_discovery: too big uuid_count value %u", |