diff --git a/[refs] b/[refs] index 60b3d06280c5..ae1ed69a893b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cf39cc3b56bc4a562db6242d3069f65034ec7549 +refs/heads/master: bead9a3abd15710b0bdfd418daef606722d86282 diff --git a/trunk/mm/sparse.c b/trunk/mm/sparse.c index f6a43c09c322..98d6b39c3472 100644 --- a/trunk/mm/sparse.c +++ b/trunk/mm/sparse.c @@ -149,8 +149,18 @@ static inline int sparse_early_nid(struct mem_section *section) /* Record a memory area against a node. */ void __init memory_present(int nid, unsigned long start, unsigned long end) { + unsigned long max_arch_pfn = 1UL << (MAX_PHYSMEM_BITS-PAGE_SHIFT); unsigned long pfn; + /* + * Sanity checks - do not allow an architecture to pass + * in larger pfns than the maximum scope of sparsemem: + */ + if (start >= max_arch_pfn) + return; + if (end >= max_arch_pfn) + end = max_arch_pfn; + start &= PAGE_SECTION_MASK; for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { unsigned long section = pfn_to_section_nr(pfn);