diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index f8824a24cca2e0..3282015f4e0149 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -1133,12 +1133,16 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance) /* Updating parameters of an active instance will return a * Command Disallowed error, so we must first disable the - * instance if it is active. + * instance if it is active. This call may fail if the instance + * has been removed from the controller. */ if (adv && !adv->pending) { err = hci_disable_ext_adv_instance_sync(hdev, instance); if (err) - return err; + bt_dev_dbg(hdev, "Error code %d while disabling \ + instance %d. Continue \ + re-registering the instance", + err, instance); } flags = hci_adv_instance_flags(hdev, instance); @@ -5522,10 +5526,6 @@ static int hci_power_off_sync(struct hci_dev *hdev) goto out; } - err = hci_clear_adv_sync(hdev, NULL, false); - if (err) - goto out; - err = hci_stop_discovery_sync(hdev); if (err) goto out;