Skip to content

Commit 9830b5a

Browse files
committed
nrf_rpc: fix initialization corner case
When initializing multiple groups that share the same transport, it may happen that a device receives an init packet for a group whose internal members have not been initialized yet, leading to the bus fault. Make sure that internal members of all groups have been initialized before ANY transport is started to prevent that. Signed-off-by: Damian Krolik <[email protected]>
1 parent 7aa44cd commit 9830b5a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nrf_rpc/nrf_rpc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,12 @@ static int transport_init(nrf_rpc_tr_receive_handler_t receive_cb)
437437
continue;
438438
}
439439
}
440+
}
441+
442+
for (NRF_RPC_AUTO_ARR_FOR(iter, group, &nrf_rpc_groups_array,
443+
const struct nrf_rpc_group)) {
444+
const struct nrf_rpc_tr *transport = group->transport;
445+
struct nrf_rpc_group_data *data = group->data;
440446

441447
err = transport->api->init(transport, receive_cb, NULL);
442448
if (err) {

0 commit comments

Comments
 (0)