From: Michal Suchanek <msuchanek@suse.de>
To: Hari Bathini <hbathini@linux.vnet.ibm.com>,
linuxppc-dev <linuxppc-dev@ozlabs.org>,
Andrew Morton <akpm@linux-foundation.org>,
Ankit Kumar <ankit@linux.vnet.ibm.com>,
lkml <linux-kernel@vger.kernel.org>,
Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>
Cc: Michal Suchanek <msuchanek@suse.de>
Subject: [PATCH] Fix parse_args cycle limit check.
Date: Fri, 15 Dec 2017 22:41:49 +0100 [thread overview]
Message-ID: <20171215214149.3692-1-msuchanek@suse.de> (raw)
In-Reply-To: <20171215214702.7c7afba1@kitsune.suse.cz>
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
next prev parent reply other threads:[~2017-12-15 21:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 15:16 [PATCH v9 0/8] reduce memory consumption for powerpc firmware-assisted capture kernel Hari Bathini
2017-11-15 15:16 ` [PATCH v9 1/8] lib/cmdline.c: remove quotes symmetrically Hari Bathini
2017-12-15 20:51 ` Michal Suchánek
2017-11-15 15:17 ` [PATCH v9 2/8] boot/param: add pointer to current and next argument to unknown parameter callback Hari Bathini
2017-12-15 20:47 ` Michal Suchánek
2017-12-15 21:41 ` Michal Suchanek [this message]
2017-12-15 23:49 ` [PATCH] Fix parse_args cycle limit check Randy Dunlap
2017-12-18 17:34 ` Michal Suchánek
2017-12-18 17:57 ` Randy Dunlap
2017-11-15 15:17 ` [PATCH v9 3/8] lib/cmdline.c: add backslash support to kernel commandline parsing Hari Bathini
2017-11-15 15:17 ` [PATCH v9 4/8] Documentation/admin-guide: backslash support in commandline Hari Bathini
2017-11-15 15:18 ` [PATCH v9 5/8] lib/cmdline.c: implement single quotes in commandline argument parsing Hari Bathini
2017-12-15 21:49 ` [PATCH] Optimize final quote removal Michal Suchanek
2017-11-15 15:18 ` [PATCH v9 6/8] Documentation/admin-guide: single quotes in kernel arguments Hari Bathini
2017-11-15 15:19 ` [PATCH v9 7/8] powerpc/fadump: reduce memory consumption for capture kernel Hari Bathini
2017-11-15 15:19 ` [PATCH v9 8/8] powerpc/fadump: update documentation about 'fadump_extra_args=' parameter Hari Bathini
2022-03-11 17:02 ` [PATCH v9 0/8] reduce memory consumption for powerpc firmware-assisted capture kernel Christophe Leroy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171215214149.3692-1-msuchanek@suse.de \
--to=msuchanek@suse.de \
--cc=akpm@linux-foundation.org \
--cc=ankit@linux.vnet.ibm.com \
--cc=hbathini@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mahesh@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).