shared/bap: ucast streams can only have one link
authorPauli Virtanen <pav@iki.fi>
Sat, 26 Oct 2024 10:13:39 +0000 (13:13 +0300)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 20 Feb 2025 07:43:24 +0000 (16:43 +0900)
In unicast, linked streams mean bidirectional CIS.  Ucast stream can
have at most one linked stream.

Fix ucast streams to have only single link. This fixes eg. configuring
for AC 11(i).

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
src/shared/bap.c

index dad510aecd356c36b7efb726ee44e2f383e7b631..658ee1370bd89de12db53080771344971d509b40 100644 (file)
@@ -2422,8 +2422,7 @@ static int bap_ucast_io_link(struct bt_bap_stream *stream,
 
        bap = stream->bap;
 
-       if (queue_find(stream->links, NULL, link) ||
-               queue_find(link->links, NULL, stream))
+       if (!queue_isempty(stream->links) || !queue_isempty(link->links))
                return -EALREADY;
 
        if (stream->client != link->client ||