Merge branches 'gpio/merge' and 'spi/merge' of git://git.secretlab.ca/git/linux-2.6
[firefly-linux-kernel-4.4.55.git] / mm / memory_hotplug.c
index 89b0391f14a8e9fc29cbdf04c753e89d3e22d4d0..02159c755136ea0463f57a2a951f9cad223aceb1 100644 (file)
@@ -374,10 +374,6 @@ void online_page(struct page *page)
                totalhigh_pages++;
 #endif
 
-#ifdef CONFIG_FLATMEM
-       max_mapnr = max(pfn, max_mapnr);
-#endif
-
        ClearPageReserved(page);
        init_page_count(page);
        __free_page(page);
@@ -498,6 +494,12 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)
        /* init node's zones as empty zones, we don't have any present pages.*/
        free_area_init_node(nid, zones_size, start_pfn, zholes_size);
 
+       /*
+        * The node we allocated has no zone fallback lists. For avoiding
+        * to access not-initialized zonelist, build here.
+        */
+       build_all_zonelists(NULL);
+
        return pgdat;
 }