summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/cbfstool/cbfstool.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 57c9e5117f..2f920e0988 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -255,7 +255,8 @@ static int find_mmap_window(enum mmap_addr_type addr_type, unsigned int addr)
else
reg = &mmap_window_table[i].flash_space;
- if (region_offset(reg) <= addr && region_end(reg) >= addr)
+ if (region_offset(reg) <= addr &&
+ ((uint64_t)region_offset(reg) + (uint64_t)region_sz(reg) - 1) >= addr)
return i;
}