From: Hari Bathini <hbathini@linux.vnet.ibm.com>
To: linuxppc-dev <linuxppc-dev@ozlabs.org>
Cc: stable@vger.kernel.org#2.6.32+,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
ben@codiert.org, Paul Mackerras <paulus@samba.org>,
sjitindarsingh@gmail.com, Michael Ellerman <mpe@ellerman.id.au>
Subject: [PATCH 3/4] powerpc/prom: fix early parsing of 'mem=' parameter
Date: Thu, 03 Aug 2017 14:55:19 +0530 [thread overview]
Message-ID: <150175231914.9806.17417587831837918447.stgit@hbathini.in.ibm.com> (raw)
In-Reply-To: <150175227508.9806.17545018023658850483.stgit@hbathini.in.ibm.com>
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 --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
next prev parent reply other threads:[~2017-08-03 9:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 9:24 [PATCH 1/4] powerpc/prom: avoid endian conversions for linux, memory-limit node Hari Bathini
2017-08-03 9:24 ` [PATCH 2/4] powerpc/prom: fix early parsing of parameters Hari Bathini
2017-08-06 8:36 ` kbuild test robot
2017-08-03 9:25 ` Hari Bathini [this message]
2017-08-03 9:25 ` [PATCH 4/4] powerpc/prom: fix early parsing of 'disable_radix' parameter Hari Bathini
2017-08-04 1:37 ` [PATCH 1/4] powerpc/prom: avoid endian conversions for linux, memory-limit node Benjamin Herrenschmidt
2017-08-04 1:47 ` Benjamin Herrenschmidt
2017-08-04 5:35 ` Hari Bathini
2017-08-04 3:51 ` Michael Ellerman
2017-08-04 5:32 ` Hari Bathini
2017-08-04 10:14 ` Michael Ellerman
2017-08-04 18:38 ` Hari Bathini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=150175231914.9806.17417587831837918447.stgit@hbathini.in.ibm.com \
--to=hbathini@linux.vnet.ibm.com \
--cc=ben@codiert.org \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=sjitindarsingh@gmail.com \
--cc=stable@vger.kernel.org#2.6.32+ \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).