Skip to content

Commit

Permalink
tools/bootconfig: Fix to return 0 if succeeded to show the bootconfig
Browse files Browse the repository at this point in the history
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: 950313e ("tools: bootconfig: Add bootconfig command")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Masami Hiramatsu authored and Steven Rostedt (VMware) committed Jun 17, 2020
1 parent 272da32 commit f91cb5b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/bootconfig/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit f91cb5b

Please sign in to comment.