[PATCH BlueZ v3 3/3] shared/bap: Make bt_bap_ref_safe check if the instance is attached

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

This makes bt_bap_ref_safe check that bap instance is part of sessions
list which means it is attached/valid.
---
 src/shared/bap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 4722ed1a1b27..804352db9c41 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -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);
-- 
2.43.0





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux