This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 138b42be5 nimble/ll: Fix allocating BIG
138b42be5 is described below

commit 138b42be52c0917f93f44f9629a1ddfd43ec9d63
Author: Andrzej Kaczmarek <[email protected]>
AuthorDate: Tue Feb 25 16:25:40 2025 +0100

    nimble/ll: Fix allocating BIG
    
    BIG handle has to be assigned before other checks that may fail as it's
    used to check if BIG is allocated. If not assigned properly, the BIG may
    not be freed in case of an error.
---
 nimble/controller/src/ble_ll_iso_big.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/controller/src/ble_ll_iso_big.c 
b/nimble/controller/src/ble_ll_iso_big.c
index 2b84e9807..570bf01a7 100644
--- a/nimble/controller/src/ble_ll_iso_big.c
+++ b/nimble/controller/src/ble_ll_iso_big.c
@@ -1006,6 +1006,7 @@ ble_ll_iso_big_create(uint8_t big_handle, uint8_t 
adv_handle, uint8_t num_bis,
     BLE_LL_ASSERT(big);
 
     big_pool_free--;
+    big->handle = big_handle;
 
     advsm = ble_ll_adv_sync_get(adv_handle);
     if (!advsm) {
@@ -1019,7 +1020,6 @@ ble_ll_iso_big_create(uint8_t big_handle, uint8_t 
adv_handle, uint8_t num_bis,
     }
 
     big->advsm = advsm;
-    big->handle = big_handle;
 
     big->crc_init = ble_ll_rand();
     memcpy(big->chan_map, g_ble_ll_data.chan_map, BLE_LL_CHAN_MAP_LEN);

Reply via email to