mm: sparse: fix section usemap placement calculation
[linux-2.6-block.git] / mm / sparse.c
index 6a4bf9160e855ae1e2d61fefb4922918f710bb24..e861397016a9e89ad49732c1b8174e455e19ca0b 100644 (file)
@@ -287,7 +287,7 @@ sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat,
         * from the same section as the pgdat where possible to avoid
         * this problem.
         */
-       goal = __pa(pgdat) & PAGE_SECTION_MASK;
+       goal = __pa(pgdat) & (PAGE_SECTION_MASK << PAGE_SHIFT);
        host_pgdat = NODE_DATA(early_pfn_to_nid(goal >> PAGE_SHIFT));
        return __alloc_bootmem_node_nopanic(host_pgdat, size,
                                            SMP_CACHE_BYTES, goal);