diff options
author | Archie Pusaka <apusaka@chromium.org> | 2021-11-11 08:20:54 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2021-11-16 17:17:51 +0300 |
commit | 1f9d56574334590b836695cfec78dad029f36dba (patch) | |
tree | fa1bc85a303c3d9f543db3f1a5fc13337941fe13 /net | |
parent | 0f281a5e5b673698c246da5d7bf0d5fa427c47c5 (diff) | |
download | linux-1f9d56574334590b836695cfec78dad029f36dba.tar.xz |
Bluetooth: Attempt to clear HCI_LE_ADV on adv set terminated error event
We should clear the flag if the adv instance removed due to receiving
this error status is the last one we have.
Signed-off-by: Archie Pusaka <apusaka@chromium.org>
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_event.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 8eae38129a6e..efc5458b1345 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -5527,7 +5527,7 @@ static void hci_le_ext_adv_term_evt(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_evt_le_ext_adv_set_term *ev = (void *) skb->data; struct hci_conn *conn; - struct adv_info *adv; + struct adv_info *adv, *n; BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); @@ -5553,6 +5553,13 @@ static void hci_le_ext_adv_term_evt(struct hci_dev *hdev, struct sk_buff *skb) hci_remove_adv_instance(hdev, ev->handle); mgmt_advertising_removed(NULL, hdev, ev->handle); + list_for_each_entry_safe(adv, n, &hdev->adv_instances, list) { + if (adv->enabled) + return; + } + + /* We are no longer advertising, clear HCI_LE_ADV */ + hci_dev_clear_flag(hdev, HCI_LE_ADV); return; } |