summaryrefslogtreecommitdiff
path: root/src/dev/arm/flash_device.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev/arm/flash_device.cc')
-rw-r--r--src/dev/arm/flash_device.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dev/arm/flash_device.cc b/src/dev/arm/flash_device.cc
index 8e337cd86..b0b855349 100644
--- a/src/dev/arm/flash_device.cc
+++ b/src/dev/arm/flash_device.cc
@@ -379,7 +379,8 @@ FlashDevice::remap(uint64_t logic_page_addr)
block = locationTable[logic_page_addr].block * pagesPerBlock;
//assumption: clean will improve locality
- for (uint32_t count = 0; count < pageSize; count++) {
+ for (uint32_t count = 0; count < pagesPerBlock; count++) {
+ assert(block + count < pagesPerDisk);
locationTable[block + count].page = (block + count) %
pagesPerBlock;
++count;