summaryrefslogtreecommitdiff
path: root/tools/bootconfig
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2020-05-08 18:07:56 +0300
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-05-12 00:00:26 +0300
commit9d82ccda2bc5c148060543d249d54f8703741bb4 (patch)
treeac3f7c00624e2cdce116ecdf95f6c3d710385181 /tools/bootconfig
parent8842604446d1f005abcbf8c63c12eabdb5695094 (diff)
downloadlinux-9d82ccda2bc5c148060543d249d54f8703741bb4.tar.xz
tools/bootconfig: Fix apply_xbc() to return zero on success
The return of apply_xbc() returns the result of the last write() call, which is not what is expected. It should only return zero on success. Link: https://lore.kernel.org/r/20200508093059.GF9365@kadam Fixes: 8842604446d1 ("tools/bootconfig: Fix resource leak in apply_xbc()") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Tested-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'tools/bootconfig')
-rw-r--r--tools/bootconfig/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 001076c51712..0efaf45f7367 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -337,6 +337,7 @@ int apply_xbc(const char *path, const char *xbc_path)
pr_err("Failed to apply a boot config magic: %d\n", ret);
goto out;
}
+ ret = 0;
out:
close(fd);
free(data);