[PATCH BlueZ v2 2/2] bap: Use util_iov_new when setting bcode

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

 



Currently the broadcast code is set without memory being allocated
for it resulting in segmentation fault. This fixes the issue by using
the newly created util_iov_new that allocates the memory before
setting it.
---
 profiles/audio/bap.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 53e7b3e34..e82a25382 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -1042,9 +1042,8 @@ static void create_stream_for_bis(struct bap_data *bap_data,
 	setup->qos.bcast.framing = qos->bcast.framing;
 	setup->qos.bcast.encryption = qos->bcast.encryption;
 	if (setup->qos.bcast.encryption)
-		util_iov_append(setup->qos.bcast.bcode,
-				qos->bcast.bcode,
-				sizeof(qos->bcast.bcode));
+		setup->qos.bcast.bcode = util_iov_new(qos->bcast.bcode,
+						sizeof(qos->bcast.bcode));
 	setup->qos.bcast.options = qos->bcast.options;
 	setup->qos.bcast.skip = qos->bcast.skip;
 	setup->qos.bcast.sync_timeout = qos->bcast.sync_timeout;
-- 
2.40.1





[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