summaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/um_arch.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2017-04-27 12:15:10 +0900
committerRichard Weinberger <richard@nod.at>2017-05-03 22:38:16 +0200
commit5b4236e17cc1bd9fa14b2b0c7a4ae632d41f2e20 (patch)
treeece1dff46ebb0f66add8226030fdc1addbf0d526 /arch/um/kernel/um_arch.c
parent601b7b9147455a4d8d80d04f0e5a1eb222301bbe (diff)
downloadlinux-5b4236e17cc1bd9fa14b2b0c7a4ae632d41f2e20.tar.bz2
um: Fix to call read_initrd after init_bootmem
Since read_initrd() invokes alloc_bootmem() for allocating memory to load initrd image, it must be called after init_bootmem. This makes read_initrd() called directly from setup_arch() after init_bootmem() and mem_total_pages(). Cc: <stable@vger.kernel.org> Fixes: b63236972e1 ("um: Setup physical memory in setup_arch()") Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/kernel/um_arch.c')
-rw-r--r--arch/um/kernel/um_arch.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 4b85acd4020c..64a1fd06f3fd 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -338,11 +338,17 @@ int __init linux_main(int argc, char **argv)
return start_uml();
}
+int __init __weak read_initrd(void)
+{
+ return 0;
+}
+
void __init setup_arch(char **cmdline_p)
{
stack_protections((unsigned long) &init_thread_info);
setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
mem_total_pages(physmem_size, iomem_size, highmem);
+ read_initrd();
paging_init();
strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);