LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Julio Faracco <jcfaracco@gmail.com>,
	stable@vgar.kernel.org
Subject: [PATCH v3 5/6] bootconfig: Fix missing return check of xbc_node_compose_key function
Date: Sun,  5 Sep 2021 00:54:38 +0900	[thread overview]
Message-ID: <163077087861.222577.12884543474750968146.stgit@devnote2> (raw)
In-Reply-To: <163077084169.222577.4459698040375322439.stgit@devnote2>

From: Julio Faracco <jcfaracco@gmail.com>

The function `xbc_show_list should` handle the keys during the
composition. Even the errors returned by the compose function. Instead
of removing the `ret` variable, it should save the value and show the
exact error. This missing variable is causing a compilation issue also.

Fixes: e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key")
Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: stable@vgar.kernel.org
---
 tools/bootconfig/main.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index f45fa992e01d..fd67496a947f 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -111,9 +111,11 @@ static void xbc_show_list(void)
 	char key[XBC_KEYLEN_MAX];
 	struct xbc_node *leaf;
 	const char *val;
+	int ret;
 
 	xbc_for_each_key_value(leaf, val) {
-		if (xbc_node_compose_key(leaf, key, XBC_KEYLEN_MAX) < 0) {
+		ret = xbc_node_compose_key(leaf, key, XBC_KEYLEN_MAX);
+		if (ret < 0) {
 			fprintf(stderr, "Failed to compose key %d\n", ret);
 			break;
 		}


  parent reply	other threads:[~2021-09-04 15:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04 15:54 [PATCH v3 0/6] bootconfig: Cleanup and reorder the init parameter from bootconfig Masami Hiramatsu
2021-09-04 15:54 ` [PATCH v3 1/6] init: bootconfig: Remove all bootconfig data when the init memory is removed Masami Hiramatsu
2021-09-04 15:54 ` [PATCH v3 2/6] init/bootconfig: Reorder init parameter from bootconfig and cmdline Masami Hiramatsu
2021-09-04 15:54 ` [PATCH v3 3/6] docs: bootconfig: Add how to use bootconfig for kernel parameters Masami Hiramatsu
2021-09-04 15:54 ` [PATCH v3 4/6] tools/bootconfig: Fix tracing_on option checking in ftrace2bconf.sh Masami Hiramatsu
2021-09-04 15:54 ` Masami Hiramatsu [this message]
2021-09-04 15:54 ` [PATCH v3 6/6] tools/bootconfig: Show whole test command for each test case Masami Hiramatsu
2021-09-08  3:46 ` [PATCH v3 0/6] bootconfig: Cleanup and reorder the init parameter from bootconfig Masami Hiramatsu
2021-09-08  7:28   ` Steven Rostedt

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=163077087861.222577.12884543474750968146.stgit@devnote2 \
    --to=mhiramat@kernel.org \
    --cc=jcfaracco@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@vgar.kernel.org \
    --subject='Re: [PATCH v3 5/6] bootconfig: Fix missing return check of xbc_node_compose_key function' \
    /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

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).