mm/memblock.c: fix bug in early_dyn_memhotplug

idx should be added after it is used, now it's added before
it is used. This is a bug, so fix it.

Change-Id: Ia875350b5cd30f9a8c1b57edac61163ef4e11cb1
Signed-off-by: Jiacheng Zheng <jiaczhen@codeaurora.org>
tirimbino
Jiacheng Zheng 5 years ago
parent 9529f9717e
commit e40d712309
  1. 4
      mm/memblock.c

@ -1838,8 +1838,8 @@ static int __init early_dyn_memhotplug(char *p)
struct memblock_region *rgn;
int blk = 0;
while ((idx++) < memblock.memory.cnt) {
rgn = &memblock.memory.regions[idx];
while (idx < memblock.memory.cnt) {
rgn = &memblock.memory.regions[idx++];
addr = ALIGN(rgn->base, MIN_MEMORY_BLOCK_SIZE);
rgn_end = rgn->base + rgn->size;
while (addr + MIN_MEMORY_BLOCK_SIZE <= rgn_end) {

Loading…
Cancel
Save