summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/memremap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/memremap.c b/kernel/memremap.c
index ada31b0d76d4..4ef97525a4ff 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -293,7 +293,8 @@ static void devm_memremap_pages_release(void *data)
/* pages are dead and unused, undo the arch mapping */
align_start = res->start & ~(SECTION_SIZE - 1);
- align_size = ALIGN(resource_size(res), SECTION_SIZE);
+ align_size = ALIGN(res->start + resource_size(res), SECTION_SIZE)
+ - align_start;
mem_hotplug_begin();
arch_remove_memory(align_start, align_size, pgmap->altmap_valid ?
OpenPOWER on IntegriCloud