aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorArchie Pusaka <apusaka@chromium.org>2021-04-01 11:11:33 +0800
committerMarcel Holtmann <marcel@holtmann.org>2021-04-02 11:06:17 +0200
commit06752d1678b49ac471f11950ebd6d29541828bba (patch)
tree8aa2210b419533a72f99a214c9338ca794864e22 /net
parentBluetooth: Coding style fix (diff)
downloadlinux-dev-06752d1678b49ac471f11950ebd6d29541828bba.tar.xz
linux-dev-06752d1678b49ac471f11950ebd6d29541828bba.zip
Bluetooth: Check inquiry status before sending one
There is a possibility where HCI_INQUIRY flag is set but we still send HCI_OP_INQUIRY anyway. Such a case can be reproduced by connecting to an LE device while active scanning. When the device is discovered, we initiate a connection, stop LE Scan, and send Discovery MGMT with status disabled, but we don't cancel the inquiry. Signed-off-by: Archie Pusaka <apusaka@chromium.org> Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_request.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 6cd9d41eda44..5b4eb87b19f0 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -2950,6 +2950,9 @@ static int bredr_inquiry(struct hci_request *req, unsigned long opt)
const u8 liac[3] = { 0x00, 0x8b, 0x9e };
struct hci_cp_inquiry cp;
+ if (test_bit(HCI_INQUIRY, &req->hdev->flags))
+ return 0;
+
bt_dev_dbg(req->hdev, "");
hci_dev_lock(req->hdev);