Skip to content

Commit 44d8553

Browse files
bas-archembeddedkartben
authored andcommitted
mgmt: mcumgr: transport: smp: Fix smp_transport_clients list init.
Make sure smp_transport_clients list is only initialized once and before any transports will try to register and add entries to this list. The smp_init() routine was called after smp_init_uart(), causing the list to be emptied again after registration of the uart client transport. Signed-off-by: Bas van Loon <[email protected]>
1 parent 47fc9a1 commit 44d8553

File tree

1 file changed

+1
-5
lines changed
  • subsys/mgmt/mcumgr/transport/src

1 file changed

+1
-5
lines changed

subsys/mgmt/mcumgr/transport/src/smp.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ K_THREAD_STACK_DEFINE(smp_work_queue_stack, CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_ST
3232
static struct k_work_q smp_work_queue;
3333

3434
#ifdef CONFIG_SMP_CLIENT
35-
static sys_slist_t smp_transport_clients;
35+
static sys_slist_t smp_transport_clients = SYS_SLIST_STATIC_INIT(&smp_transport_clients);
3636
#endif
3737

3838
static const struct k_work_queue_config smp_work_queue_config = {
@@ -266,10 +266,6 @@ void smp_rx_clear(struct smp_transport *zst)
266266

267267
static int smp_init(void)
268268
{
269-
#ifdef CONFIG_SMP_CLIENT
270-
sys_slist_init(&smp_transport_clients);
271-
#endif
272-
273269
k_work_queue_init(&smp_work_queue);
274270

275271
k_work_queue_start(&smp_work_queue, smp_work_queue_stack,

0 commit comments

Comments
 (0)