All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/bootconfig: Fix apply_xbc() to return zero on success
@ 2020-05-08 15:13 Steven Rostedt
  2020-05-08 23:14 ` Masami Hiramatsu
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2020-05-08 15:13 UTC (permalink / raw)
  To: LKML; +Cc: Masami Hiramatsu, Dan Carpenter, Yunfeng Ye, Shiyuan Hu, Hewenliang

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

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>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 tools/bootconfig/main.c | 1 +
 1 file changed, 1 insertion(+)

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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-09  0:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 15:13 [PATCH] tools/bootconfig: Fix apply_xbc() to return zero on success Steven Rostedt
2020-05-08 23:14 ` Masami Hiramatsu
2020-05-09  0:11   ` Masami Hiramatsu
2020-05-09  0:58     ` [PATCH] tools/bootconfig: Add a summary of test cases and return error Masami Hiramatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.