Home Home > GIT Browse > SLE11-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2018-06-08 11:18:39 +0200
committerJiri Kosina <jkosina@suse.cz>2018-06-08 11:18:39 +0200
commit03a7b12129e1154bf366b5a1b38617376ca0489d (patch)
treea62753309951dde75052648d763ec93b1519132b
parentb04aa43840a2ae8f927a6b01124bd671442d1879 (diff)
x86/boot: Fix early command-line parsing when partial word
matches (bsc#1096140). suse-commit: e5ea61f87f9d99796136bdfdac5c82b9ce0d2ab6
-rw-r--r--arch/x86/lib/cmdline.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/x86/lib/cmdline.c b/arch/x86/lib/cmdline.c
index 88ce150186c6..6dae7ccd892d 100644
--- a/arch/x86/lib/cmdline.c
+++ b/arch/x86/lib/cmdline.c
@@ -72,18 +72,26 @@ int cmdline_find_option_bool(const char *cmdline, const char *option)
*/
if (!c || myisspace(c))
return wstart;
- else
- state = st_wordskip;
+ /*
+ * We hit the end of the option, but _not_
+ * the end of a word on the cmdline. Not
+ * a match.
+ */
} else if (!c) {
/*
* Hit the NULL terminator on the end of
* cmdline.
*/
return 0;
- } else if (c != *opptr++) {
- state = st_wordskip;
+ } else if (c == *opptr++) {
+ /*
+ * We are currently matching, so continue
+ * to the next character on the cmdline.
+ */
+ break;
}
- break;
+ state = st_wordskip;
+ /* fall through */
case st_wordskip:
if (!c)