Skip to content

Commit 4bf653a

Browse files
Thalleykartben
authored andcommitted
samples: Bluetooth: CAP: Add missing k_sem_init
The source_stream_sem and sink_stream_sem semaphores were never initialized, and thus when a disconnect happened the call(s) to k_sem_give would fail fatally. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 86098ac commit 4bf653a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

samples/bluetooth/cap_acceptor/src/cap_acceptor_unicast.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,5 +456,8 @@ int init_cap_acceptor_unicast(struct peer_config *peer)
456456
}
457457
}
458458

459+
k_sem_init(&peer->source_stream_sem, 0, 1);
460+
k_sem_init(&peer->sink_stream_sem, 0, 1);
461+
459462
return 0;
460463
}

0 commit comments

Comments
 (0)