summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drivers/mrc_cache/mrc_cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/mrc_cache/mrc_cache.c b/src/drivers/mrc_cache/mrc_cache.c
index 3b98dbaa63..eb43123c67 100644
--- a/src/drivers/mrc_cache/mrc_cache.c
+++ b/src/drivers/mrc_cache/mrc_cache.c
@@ -337,10 +337,10 @@ static bool mrc_cache_needs_update(const struct region_device *rdev,
const void *new_data, size_t new_data_size)
{
void *mapping, *data_mapping;
- size_t size = region_device_sz(rdev);
+ size_t old_data_size = region_device_sz(rdev) - sizeof(struct mrc_metadata);
bool need_update = false;
- if (new_data_size != size)
+ if (new_data_size != old_data_size)
return true;
mapping = rdev_mmap_full(rdev);