Skip to contentSkip to conversation

Parse boot parameter error?

PATCH Shaohua Li 1 participant 1 message Dec 13, 2006

lore
Share & tools
lore

Shaohua Li

author
#0 lore raw

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.

init/main.c +2 -1
index 036f97c..d56940c 100644
@@ -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).