[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171215214149.3692-1-msuchanek@suse.de>
Date: Fri, 15 Dec 2017 22:41:49 +0100
From: Michal Suchanek <msuchanek@...e.de>
To: Hari Bathini <hbathini@...ux.vnet.ibm.com>,
linuxppc-dev <linuxppc-dev@...abs.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Ankit Kumar <ankit@...ux.vnet.ibm.com>,
lkml <linux-kernel@...r.kernel.org>,
Mahesh J Salgaonkar <mahesh@...ux.vnet.ibm.com>
Cc: Michal Suchanek <msuchanek@...e.de>
Subject: [PATCH] Fix parse_args cycle limit check.
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
Powered by blists - more mailing lists