[PATCH] Fix parse_args cycle limit check.
From: Michal Suchanek
Date: Fri Dec 15 2017 - 16:42:14 EST
Actually args are supposed to be renamed to next so both and args hold the
previous argument so both can be passed to the callback. This additionla patch
should fix up the rename.
---
kernel/params.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/kernel/params.c b/kernel/params.c
index 69ff58e69887..efb4dfaa6bc5 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -182,17 +182,18 @@ char *parse_args(const char *doing,
if (*args)
pr_debug("doing %s, parsing ARGS: '%s'\n", doing, args);
+ else
+ return err;
- next = next_arg(args, ¶m, &val);
- while (*next) {
+ do {
int ret;
int irq_was_disabled;
- args = next;
next = next_arg(args, ¶m, &val);
+
/* Stop at -- */
if (!val && strcmp(param, "--") == 0)
- return err ?: args;
+ return err ?: next;
irq_was_disabled = irqs_disabled();
ret = parse_one(param, val, args, next, doing, params, num,
min_level, max_level, arg, unknown);
@@ -215,9 +216,10 @@ char *parse_args(const char *doing,
doing, val ?: "", param);
break;
}
-
err = ERR_PTR(ret);
- }
+
+ args = next;
+ } while (*args);
return err;
}
--
2.13.6