mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Parse boot parameter error?
@ 2006-12-13  5:44 Shaohua Li
  0 siblings, 0 replies; only message in thread
From: Shaohua Li @ 2006-12-13  5:44 UTC (permalink / raw)
  To: lkml; +Cc: Andrew Morton

Say a boot parameter is "xxx", if you give a string "xxxy", then the
boot parameter's corresponding function is executed. Is this intended?
If not, below patch fixes it.

diff --git a/init/main.c b/init/main.c
index 036f97c..d56940c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -193,7 +193,8 @@ static int __init obsolete_checksetup(ch
 	p = __setup_start;
 	do {
 		int n = strlen(p->str);
-		if (!strncmp(line, p->str, n)) {
+		if (((!strncmp(line, p->str, n)) && (p->str[n-1] == '='))
+				|| !strcmp(line, p->str)) {
 			if (p->early) {
 				/* Already done in parse_early_param?
 				 * (Needs exact match on param part).

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-13  5:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-13  5:44 Parse boot parameter error? Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®