summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/nvmem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/nvmem.c b/common/nvmem.c
index 3696d00279..ffdb78bb2d 100644
--- a/common/nvmem.c
+++ b/common/nvmem.c
@@ -314,13 +314,14 @@ int nvmem_setup(uint8_t starting_version)
* both corrupted
*/
for (part = 0; part < NVMEM_NUM_PARTITIONS; part++) {
+ /* Set active partition variable */
+ nvmem_act_partition = part;
+
/* Get the cache buffer */
if (nvmem_lock_cache() != EC_SUCCESS) {
CPRINTF("NvMem: Cache ram not available!\n");
return EC_ERROR_TIMEOUT;
}
- /* Set active partition variable */
- nvmem_act_partition = part;
/* Fill entire partition to 0xFFs */
memset(cache.base_ptr, 0xff, NVMEM_PARTITION_SIZE);
/* Get pointer to start of partition */