mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
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: 8842604446
("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>
This commit is contained in:
parent
8842604446
commit
9d82ccda2b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user