Bluetooth: Host: conn_change signal object not correclty initialied
The problem is visible after call to bt_disable when there was
a connection. On a next bt_enable call when hc_tx_thread starts
it is possible that the conn_change object internals are not
re-initialized entirely and the function fails during k_poll call.
The commit changes explicit assignment conn_change object to
a k_poll_signal_init that does proper initialization.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c
index 624c986..7e99177 100644
--- a/subsys/bluetooth/host/conn.c
+++ b/subsys/bluetooth/host/conn.c
@@ -723,7 +723,8 @@
BT_DBG("");
- conn_change.signaled = 0U;
+ k_poll_signal_init(&conn_change);
+
k_poll_event_init(&events[ev_count++], K_POLL_TYPE_SIGNAL,
K_POLL_MODE_NOTIFY_ONLY, &conn_change);