From: Badari Pulavarty walk_memory_resource() should return failure, if it can't find the memory region in the /proc/iomem. Otherwise, offline_pages() would end up isolating pages wrongly. Signed-off-by: Badari Pulavarty Cc: KAMEZAWA Hiroyuki Signed-off-by: Andrew Morton --- diff -puN kernel/resource.c~memory-unplug-v7-memory-hotplug-cleanup-fix kernel/resource.c --- a/kernel/resource.c~memory-unplug-v7-memory-hotplug-cleanup-fix +++ a/kernel/resource.c @@ -274,7 +274,7 @@ walk_memory_resource(unsigned long start struct resource res; unsigned long pfn, len; u64 orig_end; - int ret; + int ret = -1; res.start = (u64) start_pfn << PAGE_SHIFT; res.end = ((u64)(start_pfn + nr_pages) << PAGE_SHIFT) - 1; res.flags = IORESOURCE_MEM; _