diff --git a/mm/bootmem.c b/mm/bootmem.c index e8c567177dcf83e0b8d7352c581c0565c400844c..16b9465eb4ebb385114558dcacdaf7af21678612 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c @@ -204,6 +204,8 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size, unsigned long j; i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i); i = ALIGN(i, incr); + if (i >= eidx) + break; if (test_bit(i, bdata->node_bootmem_map)) continue; for (j = i + 1; j < i + areasize; ++j) {