Skip to content

Commit

Permalink
tools/bootconfig: Fix apply_xbc() to return zero on success
Browse files Browse the repository at this point in the history
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: 8842604 ("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>
  • Loading branch information
Steven Rostedt (VMware) committed May 11, 2020
1 parent 8842604 commit 9d82ccd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/bootconfig/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9d82ccd

Please sign in to comment.