diff options
author | Zhen Lei <thunder.leizhen@huawei.com> | 2021-05-08 06:42:16 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-06-16 13:01:45 +0300 |
commit | c9cb5837e92ee3052e0e46e3cd1eb1f7a903411d (patch) | |
tree | aadfc0892b2ef2a83cb5f6472c3aaaab867ade90 /tools/bootconfig | |
parent | 16ccdcdfe668896587b3d4cb2fd6dd512b308dea (diff) | |
download | linux-c9cb5837e92ee3052e0e46e3cd1eb1f7a903411d.tar.xz |
tools/bootconfig: Fix error return code in apply_xbc()
commit e8ba0b2b64126381643bb50df3556b139a60545a upstream.
Fix to return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.
Link: https://lkml.kernel.org/r/20210508034216.2277-1-thunder.leizhen@huawei.com
Fixes: a995e6bc0524 ("tools/bootconfig: Fix to check the write failure correctly")
Reported-by: Hulk Robot <hulkci@huawei.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/bootconfig')
-rw-r--r-- | tools/bootconfig/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |