summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/soc/intel/common/mrc_cache.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/soc/intel/common/mrc_cache.c b/src/soc/intel/common/mrc_cache.c
index 4ad41582b0..cf819cfdcf 100644
--- a/src/soc/intel/common/mrc_cache.c
+++ b/src/soc/intel/common/mrc_cache.c
@@ -135,6 +135,13 @@ static int __mrc_cache_get_current(const struct mrc_data_region *region,
slot++;
}
+ /*
+ * Update pointer to the most recently saved MRC data before returning
+ * any error. This ensures that the caller can use next available slot
+ * if required.
+ */
+ *cache = verified_cache;
+
if (verified_cache == NULL)
return -1;
@@ -144,7 +151,6 @@ static int __mrc_cache_get_current(const struct mrc_data_region *region,
return -1;
}
- *cache = verified_cache;
printk(BIOS_DEBUG, "MRC cache slot %d @ %p\n", slot-1, verified_cache);
return 0;