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: 88426044 ("tools/bootconfig: Fix resource leak in apply_xbc()")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Tested-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 88426044
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment