From: Luiz Augusto von Dentz Date: Wed, 8 Dec 2021 23:43:24 +0000 (-0800) Subject: Bluetooth: hci_sync: Fix not always pausing advertising when necessary X-Git-Tag: v6.1-rc5~2306^2~110^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9446bdde51ac9cc8023c732ec0cc05e820ae8d20;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 3d28ca7..fd15fb3 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");