diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 5c9e460693f..74ff938a80f 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -4284,15 +4284,10 @@ int bt_le_adv_stop(void) { int err; - /* Advertise disable may fail if slave connections are established, - * and advertising is not kept ON as the controller does not support - * simultaneous slave connections and connectable advertising state. - * Hence, we test and clear BT_DEV_KEEP_ADVERTISING flag before trying - * to disable advertising if BT_DEV_ADVERTISING is set. + /* Make sure advertising is not re-enabled later even if it's not + * currently enabled (i.e. BT_DEV_ADVERTISING is not set). */ - if (!atomic_test_and_clear_bit(bt_dev.flags, BT_DEV_KEEP_ADVERTISING)) { - return -EALREADY; - } + atomic_clear_bit(bt_dev.flags, BT_DEV_KEEP_ADVERTISING); if (!atomic_test_bit(bt_dev.flags, BT_DEV_ADVERTISING)) { return 0;