X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=mm%2Fmemblock.c;h=483197ef613f258838c40ca4e9869bc126e7e9ea;hb=e47608ab6dbe63fefe60c211a30b3fc78a1b5d5e;hp=ff5ff3b5f1ea774403b2231aa3053865a52ee31d;hpb=7a1e8b80fb1e8ead4cec15d1fc494ed290e4d2e9;p=deliverable%2Flinux.git diff --git a/mm/memblock.c b/mm/memblock.c index ff5ff3b5f1ea..483197ef613f 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -482,7 +482,7 @@ static void __init_memblock memblock_merge_regions(struct memblock_type *type) * @flags: flags of the new region * * Insert new memblock region [@base,@base+@size) into @type at @idx. - * @type must already have extra room to accomodate the new region. + * @type must already have extra room to accommodate the new region. */ static void __init_memblock memblock_insert_region(struct memblock_type *type, int idx, phys_addr_t base, @@ -544,7 +544,7 @@ repeat: /* * The following is executed twice. Once with %false @insert and * then with %true. The first counts the number of regions needed - * to accomodate the new area. The second actually inserts them. + * to accommodate the new area. The second actually inserts them. */ base = obase; nr_new = 0; @@ -994,7 +994,10 @@ void __init_memblock __next_mem_range_rev(u64 *idx, int nid, ulong flags, if (*idx == (u64)ULLONG_MAX) { idx_a = type_a->cnt - 1; - idx_b = type_b->cnt; + if (type_b != NULL) + idx_b = type_b->cnt; + else + idx_b = 0; } for (; idx_a >= 0; idx_a--) {