public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	stable@vger.kernel.org, Masami Hiramatsu <mhiramat@kernel.org>
Subject: [for-linus][PATCH 15/17] tools/bootconfig: Fix to return 0 if succeeded to show the bootconfig
Date: Thu, 18 Jun 2020 19:56:11 -0400	[thread overview]
Message-ID: <20200618235641.330959344@goodmis.org> (raw)
In-Reply-To: 20200618235556.451120786@goodmis.org

From: Masami Hiramatsu <mhiramat@kernel.org>

Fix bootconfig to return 0 if succeeded to show the bootconfig
in initrd. Without this fix, "bootconfig INITRD" command
returns !0 even if the command succeeded to show the bootconfig.

Link: http://lkml.kernel.org/r/159230246566.65555.11891772258543514487.stgit@devnote2

Cc: stable@vger.kernel.org
Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 tools/bootconfig/main.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 21896a6675fd..e0878f5f74b1 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -207,11 +207,13 @@ int show_xbc(const char *path)
 	}
 
 	ret = load_xbc_from_initrd(fd, &buf);
-	if (ret < 0)
+	if (ret < 0) {
 		pr_err("Failed to load a boot config from initrd: %d\n", ret);
-	else
-		xbc_show_compact_tree();
-
+		goto out;
+	}
+	xbc_show_compact_tree();
+	ret = 0;
+out:
 	close(fd);
 	free(buf);
 
-- 
2.26.2



  parent reply	other threads:[~2020-06-18 23:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 23:55 [for-linus][PATCH 00/17] tracing: Updates for 5.8 Steven Rostedt
2020-06-18 23:55 ` [for-linus][PATCH 01/17] recordmcount: support >64k sections Steven Rostedt
2020-06-18 23:55 ` [for-linus][PATCH 02/17] kprobes: Suppress the suspicious RCU warning on kprobes Steven Rostedt
2020-06-18 23:55 ` [for-linus][PATCH 03/17] kprobes: Use non RCU traversal APIs on kprobe_tables if possible Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 04/17] kprobes: Fix to protect kick_kprobe_optimizer() by kprobe_mutex Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 05/17] kprobes: Remove redundant arch_disarm_kprobe() call Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 06/17] kretprobe: Prevent triggering kretprobe from within kprobe_flush_task Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 07/17] sample-trace-array: Fix sleeping function called from invalid context Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 08/17] sample-trace-array: Remove trace_array sample-instance Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 09/17] tracing: Make ftrace packed events have align of 1 Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 10/17] trace: Fix typo in allocate_ftrace_ops()s comment Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 11/17] tracing/probe: Fix memleak in fetch_op_data operations Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 12/17] tracing: Remove unused event variable in tracing_iter_reset Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 13/17] proc/bootconfig: Fix to use correct quotes for value Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 14/17] tools/bootconfig: " Steven Rostedt
2020-06-18 23:56 ` Steven Rostedt [this message]
2020-06-18 23:56 ` [for-linus][PATCH 16/17] tools/bootconfig: Add testcase for show-command and quotes test Steven Rostedt
2020-06-18 23:56 ` [for-linus][PATCH 17/17] ftrace: Fix maybe-uninitialized compiler warning 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=20200618235641.330959344@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=stable@vger.kernel.org \
    /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