Skip to content

Commit

Permalink
shared/bap: Make bt_bap_ref_safe check if the instance is attached
Browse files Browse the repository at this point in the history
This makes bt_bap_ref_safe check that bap instance is part of sessions
list which means it is attached/valid.
  • Loading branch information
Vudentz committed Feb 8, 2024
1 parent 8e76c91 commit 6dafe90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared/bap.c
Expand Up @@ -1033,7 +1033,7 @@ static void stream_notify_metadata(struct bt_bap_stream *stream)

static struct bt_bap *bt_bap_ref_safe(struct bt_bap *bap)
{
if (!bap || !bap->ref_count)
if (!bap || !bap->ref_count || !queue_find(sessions, NULL, bap))
return NULL;

return bt_bap_ref(bap);
Expand Down

0 comments on commit 6dafe90

Please sign in to comment.