[PATCH 3/4] powerpc/prom: fix early parsing of 'mem=' parameter
Hari Bathini
hbathini at linux.vnet.ibm.com
Thu Aug 3 19:25:19 AEST 2017
Early cmdline parser looks for "mem=" substring in the cmdline
string but it could also succeed when cmdline string contains
parameters like 'fadump_reserve_mem=' or such leading to undesired
results. Add support to skip proceeding in such case.
Fixes: cf68787b68a2 ("powerpc/prom_init: Evaluate mem kernel parameter for early allocation")
Cc: stable at vger.kernel.org # 2.6.32+
Cc: Benjamin Krill <ben at codiert.org>
Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Signed-off-by: Hari Bathini <hbathini at linux.vnet.ibm.com>
---
arch/powerpc/kernel/prom_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 7030145..3057a32 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -649,7 +649,7 @@ static void __init early_cmdline_parse(void)
}
#endif
opt = strstr(prom_cmd_line, "mem=");
- if (opt) {
+ if (opt && is_substring_param(prom_cmd_line, opt)) {
opt += 4;
prom_memory_limit = prom_memparse(opt, (const char **)&opt);
#ifdef CONFIG_PPC64
More information about the Linuxppc-dev
mailing list