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

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

commit 1922030943d8b21daab92a604b9911a41e3d30ed
Author: Szymon Janc <[email protected]>
AuthorDate: Tue Apr 22 16:27:36 2025 +0200

    nimble/phy: Fix resolving list entry removal in nRF5X
    
    g_nrf_irk_list is array of uint32_t while IRKs are 4 words long so
    this needs to be accounted for.
    
    This was causing IRK corruption if entry removed was not the first
    entry in memory.
---
 nimble/drivers/nrf5x/src/ble_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/drivers/nrf5x/src/ble_hw.c 
b/nimble/drivers/nrf5x/src/ble_hw.c
index 9a46fa6c8..f8cd59f09 100644
--- a/nimble/drivers/nrf5x/src/ble_hw.c
+++ b/nimble/drivers/nrf5x/src/ble_hw.c
@@ -482,7 +482,7 @@ ble_hw_resolv_list_rmv(int index)
 
     if (index < g_nrf_num_irks) {
         --g_nrf_num_irks;
-        irk_entry = &g_nrf_irk_list[index];
+        irk_entry = &g_nrf_irk_list[4 * index];
         if (g_nrf_num_irks > index) {
             memmove(irk_entry, irk_entry + 4, 16 * (g_nrf_num_irks - index));
         }

Reply via email to