diff mbox

[4/4] powerpc/prom: fix early parsing of 'disable_radix' parameter

Message ID 150175232638.9806.1165424950551046958.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 "disable_radix" substring in the cmdline
string but it could also succeed when cmdline string contains parameters
like 'x_disable_radix' or disable_radix_type=' or such causing undesired
actions. Add support to skip proceeding in such cases.

Fixes: 014d02cbf16b ("powerpc: Update to new option-vector-5 format for CAS")
Cc: stable@vger.kernel.org # 4.11+
Cc: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/prom_init.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 3057a32..169e32c 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -660,8 +660,16 @@  static void __init early_cmdline_parse(void)
 
 	opt = strstr(prom_cmd_line, "disable_radix");
 	if (opt) {
-		prom_debug("Radix disabled from cmdline\n");
-		prom_radix_disable = true;
+		/*
+		 * Check if this is prefix or suffix of some other parameter
+		 * before proceeding.
+		 */
+		p = (char *)(opt + 13);
+		if ((*p == ' ' || *p == '"' || *p == '\0') &&
+		    is_substring_param(prom_cmd_line, opt)) {
+			prom_debug("Radix disabled from cmdline\n");
+			prom_radix_disable = true;
+		}
 	}
 }