aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorYalin Wang <Yalin.Wang@sonymobile.com>2014-09-25 22:07:09 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-10-02 16:29:17 -0400
commit421520ba98290a73b35b7644e877a48f18e06004 (patch)
treea980b63e25ac081cf33c4a9011fc0b453b1183b0 /arch/arm/mm
parent562c85cadb065e33ec9f651b8d41cdfd3054a5d0 (diff)
ARM: 8167/1: extend the reserved memory for initrd to be page aligned
This patch extends the start and end address of initrd to be page aligned, so that we can free all memory including the un-page aligned head or tail page of initrd, if the start or end address of initrd are not page aligned, the page can't be freed by free_initrd_mem() function. Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 659c75d808dc..9221645dd192 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -636,6 +636,11 @@ static int keep_initrd;
636void free_initrd_mem(unsigned long start, unsigned long end) 636void free_initrd_mem(unsigned long start, unsigned long end)
637{ 637{
638 if (!keep_initrd) { 638 if (!keep_initrd) {
639 if (start == initrd_start)
640 start = round_down(start, PAGE_SIZE);
641 if (end == initrd_end)
642 end = round_up(end, PAGE_SIZE);
643
639 poison_init_mem((void *)start, PAGE_ALIGN(end) - start); 644 poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
640 free_reserved_area((void *)start, (void *)end, -1, "initrd"); 645 free_reserved_area((void *)start, (void *)end, -1, "initrd");
641 } 646 }