linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] tools/bootconfig: Fix error return code in apply_xbc()
@ 2021-05-08  3:42 Zhen Lei
  2021-05-14 22:32 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Zhen Lei @ 2021-05-08  3:42 UTC (permalink / raw)
  To: Masami Hiramatsu, Steven Rostedt, linux-kernel; +Cc: Zhen Lei

Fix to return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.

Fixes: a995e6bc0524 ("tools/bootconfig: Fix to check the write failure correctly")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 tools/bootconfig/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 7362bef1a368..6cd6080cac04 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -399,6 +399,7 @@ static int apply_xbc(const char *path, const char *xbc_path)
 	}
 	/* TODO: Ensure the @path is initramfs/initrd image */
 	if (fstat(fd, &stat) < 0) {
+		ret = -errno;
 		pr_err("Failed to get the size of %s\n", path);
 		goto out;
 	}
-- 
2.25.1



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

end of thread, other threads:[~2021-05-23 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  3:42 [PATCH 1/1] tools/bootconfig: Fix error return code in apply_xbc() Zhen Lei
2021-05-14 22:32 ` Steven Rostedt
2021-05-23 14:19   ` Masami Hiramatsu

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