diff mbox

[3/4] powerpc/prom: fix early parsing of 'mem=' parameter

Message ID 150175231914.9806.17417587831837918447.stgit@hbathini.in.ibm.com
State New
Headers show

Commit Message

Hari Bathini Aug. 3, 2017, 9:25 a.m. UTC
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@vger.kernel.org # 2.6.32+
Cc: Benjamin Krill <ben@codiert.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/prom_init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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