From a594c0d26e569fa1522a949e647957974ad7da38 Mon Sep 17 00:00:00 2001 From: Astha Verma Date: Tue, 11 Feb 2025 11:26:13 +0530 Subject: [PATCH] fix(nimble): fix NVS corruption --- nimble/host/store/config/src/ble_store_nvs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimble/host/store/config/src/ble_store_nvs.c b/nimble/host/store/config/src/ble_store_nvs.c index c76d496f6..4b0ade857 100644 --- a/nimble/host/store/config/src/ble_store_nvs.c +++ b/nimble/host/store/config/src/ble_store_nvs.c @@ -509,7 +509,7 @@ populate_db_from_nvs(int obj_type, void *dst, int *db_num) db_item += sizeof(struct ble_store_value_csfc); (*db_num)++; #if MYNEWT_VAL(ENC_ADV_DATA) - } if (obj_type == BLE_STORE_OBJ_TYPE_ENC_ADV_DATA) { + } else if (obj_type == BLE_STORE_OBJ_TYPE_ENC_ADV_DATA) { ESP_LOGD(TAG, "EAD in RAM is filled up from NVS index = %d", i); memcpy(db_item, &cur.ead, sizeof(struct ble_store_value_ead)); db_item += sizeof(struct ble_store_value_ead);