aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-12-08 15:43:24 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-12-21 13:46:12 -0800
commit9446bdde51ac9cc8023c732ec0cc05e820ae8d20 (patch)
treeb4ccd5a3406f4f4c9aeab56f6ffbbc5ecfac45a3 /net/bluetooth
parentBluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_CONNECTED (diff)
downloadlinux-dev-9446bdde51ac9cc8023c732ec0cc05e820ae8d20.tar.xz
linux-dev-9446bdde51ac9cc8023c732ec0cc05e820ae8d20.zip
Bluetooth: hci_sync: Fix not always pausing advertising when necessary
hci_pause_advertising_sync shall always pause advertising until hci_resume_advertising_sync but instance 0x00 doesn't count in adv_instance_cnt so it was causing it to be skipped. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_sync.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 3d28ca7ebe45..fd15fb37a52a 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -1701,10 +1701,8 @@ static int hci_pause_advertising_sync(struct hci_dev *hdev)
int err;
int old_state;
- /* If there are no instances or advertising has already been paused
- * there is nothing to do.
- */
- if (!hdev->adv_instance_cnt || hdev->advertising_paused)
+ /* If already been paused there is nothing to do. */
+ if (hdev->advertising_paused)
return 0;
bt_dev_dbg(hdev, "Pausing directed advertising");