diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 988bd91b9f7fdd8460d2b94dbf18d05aa57d431a..656ad1c65422f0440a56b422b8431891e5304827 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -404,8 +404,15 @@ int online_pages(unsigned long pfn, unsigned long nr_pages) if (!populated_zone(zone)) need_zonelists_rebuild = 1; - walk_memory_resource(pfn, nr_pages, &onlined_pages, + ret = walk_memory_resource(pfn, nr_pages, &onlined_pages, online_pages_range); + if (ret) { + printk(KERN_DEBUG "online_pages %lx at %lx failed\n", + nr_pages, pfn); + memory_notify(MEM_CANCEL_ONLINE, &arg); + return ret; + } + zone->present_pages += onlined_pages; zone->zone_pgdat->node_present_pages += onlined_pages;