BLE host - only check mutex state if OS started.
diff --git a/net/nimble/host/src/ble_hs_misc.c b/net/nimble/host/src/ble_hs_misc.c
index 6cdfcfa..45a5662 100644
--- a/net/nimble/host/src/ble_hs_misc.c
+++ b/net/nimble/host/src/ble_hs_misc.c
@@ -74,10 +74,12 @@
void
ble_hs_misc_assert_no_locks(void)
{
- assert(!ble_hs_conn_locked_by_cur_task());
- assert(!ble_gattc_locked_by_cur_task());
- assert(!ble_gap_locked_by_cur_task());
- assert(!ble_hci_sched_locked_by_cur_task());
+ if (os_started()) {
+ assert(!ble_hs_conn_locked_by_cur_task());
+ assert(!ble_gattc_locked_by_cur_task());
+ assert(!ble_gap_locked_by_cur_task());
+ assert(!ble_hci_sched_locked_by_cur_task());
+ }
}
/**