Commit 05c58752 authored by CHANDAN VN's avatar CHANDAN VN Committed by Will Deacon

arm64: To remove initrd reserved area entry from memblock

INITRD reserved area entry is not removed from memblock
even though initrd reserved area is freed. After freeing
the memory it is released from memblock. The same can be
checked from /sys/kernel/debug/memblock/reserved.

The patch makes sure that the initrd entry is removed from
memblock when keepinitrd is not enabled.

The patch only affects accounting and debugging. This does not
fix any memory leak.
Acked-by: default avatarLaura Abbott <labbott@redhat.com>
Signed-off-by: default avatarCHANDAN VN <chandan.vn@samsung.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 6da6c0db
......@@ -646,8 +646,10 @@ static int keep_initrd __initdata;
void __init free_initrd_mem(unsigned long start, unsigned long end)
{
if (!keep_initrd)
if (!keep_initrd) {
free_reserved_area((void *)start, (void *)end, 0, "initrd");
memblock_free(__virt_to_phys(start), end - start);
}
}
static int __init keepinitrd_setup(char *__unused)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment