Skip to content

Commit 9d82ccd

Browse files
committed
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: 8842604 ("tools/bootconfig: Fix resource leak in apply_xbc()") Reported-by: Dan Carpenter <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Tested-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 8842604 commit 9d82ccd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/bootconfig/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ int apply_xbc(const char *path, const char *xbc_path)
337337
pr_err("Failed to apply a boot config magic: %d\n", ret);
338338
goto out;
339339
}
340+
ret = 0;
340341
out:
341342
close(fd);
342343
free(data);

0 commit comments

Comments
 (0)